用户信息修改

This commit is contained in:
仲么了
2024-01-26 16:15:40 +08:00
parent 04665478fc
commit 5267ae1903
13 changed files with 457 additions and 173 deletions

View File

@@ -47,22 +47,6 @@ const rules = {
message: '长度在 6 到 16 个字符',
trigger: 'blur'
},
{
validator: (rule: any, value: string, callback: any) => {
if (value === '') {
callback(new Error('请输入旧密码'))
} else {
passwordConfirm(value)
.then(res => {
callback()
})
.catch(() => {
callback(new Error('旧密码不正确'))
})
}
},
trigger: 'blur'
}
],
newPwd: [
{ required: true, message: '请输入密码', trigger: 'blur' },
@@ -109,12 +93,14 @@ const open = (id: string) => {
const submit = async () => {
formRef.value.validate((valid:boolean) => {
if (valid) {
updatePassword({
id: form.id,
newPassword: form.newPwd
}).then((res: any) => {
ElMessage.success('密码修改成功')
dialogVisible.value = false
passwordConfirm(form.password).then((res: any) => {
updatePassword({
id: form.id,
newPassword: form.newPwd
}).then((res: any) => {
ElMessage.success('密码修改成功')
dialogVisible.value = false
})
})
}
})