diff --git a/src/page/password/account-form.vue b/src/page/password/account-form.vue index 6639b44b1b0388f9dc43be94422015a958f09f89..6cdbb9f26925564e852aff28074e6564dcf52e43 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 8a70a27a64a06f5e447ed1ea2956fc8f2a2e96cd..634178014949f9cb9c98706598f7d0b7a44bdd9b 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 {