This commit is contained in:
乘风
2026-02-03 11:50:59 +08:00
parent a7d781a25b
commit 9a08273541
7 changed files with 213 additions and 383 deletions

View File

@@ -10,7 +10,7 @@ import { getFullBookPrice, getTotalSectionCount } from "@/lib/book-data"
export default function MyPage() {
const router = useRouter()
const { user, isLoggedIn, logout, getAllPurchases, settings, updateUser } = useStore()
const { user, isLoggedIn, logout, getAllPurchases, settings, updateUser, refreshUserProfile } = useStore()
const [showAuthModal, setShowAuthModal] = useState(false)
const [mounted, setMounted] = useState(false)
const [activeTab, setActiveTab] = useState<"overview" | "footprint">("overview")
@@ -46,6 +46,13 @@ export default function MyPage() {
loadConfig()
}, [])
// 每次进入「我的」页都刷新可提现金额等用户资料
useEffect(() => {
if (mounted && isLoggedIn && user?.id && refreshUserProfile) {
refreshUserProfile()
}
}, [mounted, isLoggedIn, user?.id])
// 绑定账号
const handleBind = async () => {
if (!bindValue.trim()) {