补充上传协议和实名认证
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user