diff --git a/src/views/systemManagement/accountManagement/index.vue b/src/views/systemManagement/accountManagement/index.vue index f0aadf9..d285494 100644 --- a/src/views/systemManagement/accountManagement/index.vue +++ b/src/views/systemManagement/accountManagement/index.vue @@ -225,15 +225,19 @@ const submitForm = (formEl: FormInstance | undefined) => { formEl.validate(valid => { if (valid) { // console.log(valid); - resetPW({ - id: passwordForm.id, - password: passwordForm.password - }).then(res => { - if (res.code === 200) { - message("重置成功", { type: "success" }); - dialogFormVisible.value = false; - } - }); + if (passwordForm.password !== passwordForm.confirmPassword) { + message("原密码要与新密码不一样!", { type: "error" }); + } else { + resetPW({ + id: passwordForm.id, + password: passwordForm.password + }).then(res => { + if (res.code === 200) { + message("重置成功", { type: "success" }); + dialogFormVisible.value = false; + } + }); + } } else { dialogFormVisible.value = false; console.log("error submit!");