修复修改密码弹窗&取消后台显示客服弹窗 & 取消退出登录profile为空抛异常的判断
This commit is contained in:
@@ -68,7 +68,7 @@ export function ChangePasswordDialog({
|
||||
})
|
||||
|
||||
// 提交处理
|
||||
const handler = form.handleSubmit(async (value) => {
|
||||
const handler = async (value: Schema) => {
|
||||
try {
|
||||
const resp = await updatePassword({
|
||||
phone: value.phone,
|
||||
@@ -90,7 +90,7 @@ export function ChangePasswordDialog({
|
||||
description: e instanceof Error ? e.message : String(e),
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={actualOpen} onOpenChange={actualOnOpenChange}>
|
||||
@@ -98,10 +98,16 @@ export function ChangePasswordDialog({
|
||||
<Button theme="outline" className={triggerClassName || 'w-24 h-9'}>修改密码</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>修改密码</DialogTitle>
|
||||
</DialogHeader>
|
||||
<Form form={form} handler={handler} className="flex flex-col gap-4 mt-4">
|
||||
<Form
|
||||
form={form}
|
||||
handler={async () => {
|
||||
const data = form.getValues()
|
||||
await handler(data)
|
||||
}}
|
||||
className="flex flex-col gap-4 mt-4">
|
||||
<DialogHeader>
|
||||
<DialogTitle>修改密码</DialogTitle>
|
||||
</DialogHeader>
|
||||
{/* 手机号输入 */}
|
||||
<FormField<Schema> name="phone" label="手机号" className="flex-auto">
|
||||
{({field}) => (
|
||||
@@ -132,22 +138,20 @@ export function ChangePasswordDialog({
|
||||
<Input {...field} placeholder="请再次输入新密码" type="password" autoComplete="new-password"/>
|
||||
)}
|
||||
</FormField>
|
||||
</Form>
|
||||
|
||||
<DialogFooter>
|
||||
<Button
|
||||
theme="outline"
|
||||
type="button"
|
||||
onClick={() => {
|
||||
actualOnOpenChange(false)
|
||||
form.reset()
|
||||
}}>
|
||||
关闭
|
||||
</Button>
|
||||
<Button onClick={handler}>
|
||||
保存
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
<DialogFooter>
|
||||
<Button
|
||||
theme="outline"
|
||||
type="button"
|
||||
onClick={() => {
|
||||
actualOnOpenChange(false)
|
||||
form.reset()
|
||||
}}>
|
||||
关闭
|
||||
</Button>
|
||||
<Button type="submit">保存</Button>
|
||||
</DialogFooter>
|
||||
</Form>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user