refactor(auth): align auth UI and mock auth API
This commit is contained in:
@@ -21,6 +21,9 @@ import { useEffect, useRef, useState } from "react"
|
||||
|
||||
export default function VerifyPage() {
|
||||
const [verifyRole, setVerifyRole] = useState<UserRole | "">("")
|
||||
const [realName, setRealName] = useState("")
|
||||
const [idNumber, setIdNumber] = useState("")
|
||||
const [gameProfile, setGameProfile] = useState("")
|
||||
const verificationStatus = useAuthStore((state) => state.verificationStatus)
|
||||
const verificationReasons = useAuthStore((state) => state.verificationReasons)
|
||||
const verifiedRoles = useAuthStore((state) => state.verifiedRoles)
|
||||
@@ -38,8 +41,21 @@ export default function VerifyPage() {
|
||||
[],
|
||||
)
|
||||
|
||||
const buildMaterials = () => {
|
||||
const materials: Record<string, string> = {
|
||||
realName,
|
||||
idNumber,
|
||||
gameProfile,
|
||||
idCardFront: "mock://idCardFront",
|
||||
idCardBack: "mock://idCardBack",
|
||||
gameScreenshot: "mock://gameScreenshot",
|
||||
}
|
||||
|
||||
return materials
|
||||
}
|
||||
|
||||
const submitWithMockApproval = (role: UserRole) => {
|
||||
submitVerification(role)
|
||||
submitVerification(role, buildMaterials())
|
||||
const oldTimer = timersRef.current.get(role)
|
||||
if (oldTimer) {
|
||||
clearTimeout(oldTimer)
|
||||
@@ -149,19 +165,34 @@ export default function VerifyPage() {
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="real-name">真实姓名</Label>
|
||||
<Input id="real-name" placeholder="请输入真实姓名" />
|
||||
<Input
|
||||
id="real-name"
|
||||
placeholder="请输入真实姓名"
|
||||
value={realName}
|
||||
onChange={(event) => setRealName(event.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="id-number">身份证号</Label>
|
||||
<Input id="id-number" placeholder="请输入身份证号" />
|
||||
<Input
|
||||
id="id-number"
|
||||
placeholder="请输入身份证号"
|
||||
value={idNumber}
|
||||
onChange={(event) => setIdNumber(event.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Separator />
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>游戏资质(打手认证)</Label>
|
||||
<Textarea placeholder="请描述你的游戏经历、段位、擅长游戏等" rows={3} />
|
||||
<Textarea
|
||||
placeholder="请描述你的游戏经历、段位、擅长游戏等"
|
||||
rows={3}
|
||||
value={gameProfile}
|
||||
onChange={(event) => setGameProfile(event.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user