修复实名认证阶段的问题

This commit is contained in:
Eamon-meng
2026-03-13 18:26:23 +08:00
parent d2d6c1709c
commit b2c36196b4

View File

@@ -98,6 +98,16 @@ export default function IdentifyPage(props: IdentifyPageProps) {
const profile = useProfileStore(store => store.profile) const profile = useProfileStore(store => store.profile)
const refreshProfile = useProfileStore(store => store.refreshProfile) const refreshProfile = useProfileStore(store => store.refreshProfile)
// 重置认证流程
const handleDialogOpenChange = async (open: boolean) => {
setOpenDialog(open)
if (!open) {
setStep('form')
setTarget('')
await refreshProfile()
}
}
// ====================== // ======================
// render // render
// ====================== // ======================
@@ -125,7 +135,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
</div> </div>
<Suspense> <Suspense>
<IfNotIdentofy> <IfNotIdentofy>
<Dialog open={openDialog} onOpenChange={setOpenDialog}> <Dialog open={openDialog} onOpenChange={handleDialogOpenChange}>
<DialogTrigger asChild> <DialogTrigger asChild>
<Button className="w-full"></Button> <Button className="w-full"></Button>
</DialogTrigger> </DialogTrigger>
@@ -165,10 +175,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
<div className="flex flex-col gap-4 items-center"> <div className="flex flex-col gap-4 items-center">
<canvas ref={canvas} width={256} height={256}/> <canvas ref={canvas} width={256} height={256}/>
<p className="text-sm text-gray-600"></p> <p className="text-sm text-gray-600"></p>
<Button onClick={async () => { <Button onClick={() => handleDialogOpenChange(false)}>
await refreshProfile()
setOpenDialog(false)
}}>
</Button> </Button>
</div> </div>
@@ -223,7 +230,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
<p className="flex gap-2 items-center justify-between w-56 self-center"> <p className="flex gap-2 items-center justify-between w-56 self-center">
<span className="flex gap-2"> <span className="flex gap-2">
<span className="bg-primary/25 text-primary w-8 h-8 rounded-full flex items-center justify-center">03</span> <span className="bg-primary/25 text-primary w-8 h-8 rounded-full flex items-center justify-center">03</span>
<span></span> <span></span>
</span> </span>
<Image alt="步骤配图" src={step3}/> <Image alt="步骤配图" src={step3}/>
</p> </p>