From 22bf74d2d82cc9acaaffdc21ace6ec46d2151fc5 Mon Sep 17 00:00:00 2001 From: lipeng Date: Tue, 11 Jul 2023 16:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/password/account-form.vue | 27 +++++++++++++++++++-------- src/page/password/index.vue | 8 ++------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/page/password/account-form.vue b/src/page/password/account-form.vue index 6639b44..6cdbb9f 100644 --- a/src/page/password/account-form.vue +++ b/src/page/password/account-form.vue @@ -16,7 +16,11 @@
- + {{ countDown > 0 ? countDown + "秒后再次获取" : "发送验证码" }}
@@ -51,13 +55,20 @@ const countDownTimer = ref(null); const accountRef = ref(null); const emit = defineEmits(["action"]); -const submitForm = async () => { +const submitForm = () => { if (!accountRef) return; - await accountRef.value.validate((valid, fields) => { + + accountRef.value.validate((valid, fields) => { if (valid) { - emit("action", accountForm); - } else { - emit("action", null); + axios + .post("/v1/api/user/forget/pwd/check", { phone: accountForm.phone, code: accountForm.code }) + .then(({ data }) => { + if (data.code == 200) { + emit("action", accountForm); + } else { + ElMessage.error(data.data); + } + }); } }); }; @@ -73,7 +84,7 @@ const setForm = (data) => { const getMsgCode = () => { if (accountForm.account) { - axios.post("/apaas/system/v5/sms/verifyCode", { phone: accountForm.phone }).then(({ data }) => { + axios.post("/v1/api/user/sms/verifyCode", { phone: accountForm.phone }).then(({ data }) => { if (data.code == 200) { countDownAction(); } else { @@ -104,7 +115,7 @@ const phoneChange = () => { if (accountForm.phone.length > 10) { accountRef.value.validateField("phone").then((valid) => { if (valid) { - axios.get(`/apaas/system/v5/user/phoneToAccount?phone=${accountForm.phone}`).then((res) => { + axios.get(`/v1/api/user/phoneToAccount?phone=${accountForm.phone}`).then((res) => { if (res.data.code == 200) { accountForm.account = res.data.data || ""; } else { diff --git a/src/page/password/index.vue b/src/page/password/index.vue index 8a70a27..6341780 100644 --- a/src/page/password/index.vue +++ b/src/page/password/index.vue @@ -53,10 +53,7 @@ ref="accountFromRef" :form-type="route.query.id ? true : false" @action="getAccountFromData"> - +
@@ -120,7 +117,6 @@ const getAccountFromData = (data) => { Object.assign(formData, data); step.value = 2; //校验手机号验证码 未出接口 - } else { } }; //密码表单检验触发事件 data为null 校验失败 @@ -131,7 +127,7 @@ const getPasswordFormData = (data) => { phone: formData.phone, password: Encrypt(formData.new_password), }; - axios.post(`/apaas/system/v5/user/update/pwd`, params).then((res) => { + axios.post(`/v1/api/user/update/pwd`, params).then((res) => { if (res.data.code == 200) { successFlag.value = true; } else { -- 2.26.0