补充上传协议和实名认证

This commit is contained in:
Eamon
2026-09-11 17:06:29 +08:00
parent 8d8c9deba7
commit 8aaf43ed79
31 changed files with 301 additions and 108 deletions

View File

@@ -9,6 +9,7 @@ import type { ApiIndexItem } from "@/lib/models/dashboard"
export type DashboardState = {
data: ApiIndexItem | null
agreementSigned: boolean | null
verified: boolean | null
loading: boolean
error: string | null
}
@@ -23,13 +24,19 @@ export type DashboardStore = DashboardState & DashboardActions
export const useDashboardStore = create<DashboardStore>()(set => ({
data: null,
agreementSigned: null,
verified: null,
loading: false,
error: null,
refresh: async () => {
set({ loading: true })
const res = await fetchApiIndex()
if (res.success) {
set({ data: res.data, error: null, loading: false })
set({
data: res.data,
verified: res.data ? res.data.UserModel?.is_verify === 1 : null,
error: null,
loading: false,
})
} else {
set({ error: res.message, loading: false })
}