From ce0233e2e0274114e1166f91de0560ea6f9fc4cc Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Mon, 22 May 2023 16:34:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Center/components/EditPasswordDialog.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/account/Center/components/EditPasswordDialog.vue b/src/views/account/Center/components/EditPasswordDialog.vue index 1e8e6843..fa226152 100644 --- a/src/views/account/Center/components/EditPasswordDialog.vue +++ b/src/views/account/Center/components/EditPasswordDialog.vue @@ -13,7 +13,7 @@ name="oldPassword" :rules="[ { required: true, message: '请输入密码' }, - { validator: checkMothods.old, trigger: 'blur' }, + { validator: checkMethods.old, trigger: 'blur' }, ]" > ({ confirmPassword: '', }); -const checkMothods = { +const checkMethods = { old: async (_rule: Rule, value: string) => { - if (!value) return Promise.reject(); + if (!value) return Promise.reject('请输入密码'); try { const resp: any = await checkOldPassword_api(value); if (resp.status === 200 && !resp.result.passed) @@ -85,7 +86,7 @@ const checkMothods = { } }, new: async (_rule: Rule, value: string) => { - if (!value) return Promise.reject(); + if (!value) return Promise.reject('请输入密码'); else if ( form.value.confirmPassword && value !== form.value.confirmPassword @@ -134,7 +135,7 @@ const handleOk = () => { .finally(() => (loading.value = false)); }); }; -console.clear(); + type formType = { oldPassword: string; newPassword: string;