Commit 22bf74d2 authored by 李鹏 's avatar 李鹏

修改密码接口联调

parent 6c34a2b3
...@@ -16,7 +16,11 @@ ...@@ -16,7 +16,11 @@
<div class="msg-code"> <div class="msg-code">
<el-input v-model="accountForm.code" placeholder="请输入" style="860px"> </el-input> <el-input v-model="accountForm.code" placeholder="请输入" style="860px"> </el-input>
<div class="yzm_img"> <div class="yzm_img">
<el-button type="primary" :disabled="countDown > 0" @click.prevent="getMsgCode()" style="width: 100%; height: 34px"> <el-button
type="primary"
:disabled="countDown > 0"
@click.prevent="getMsgCode()"
style="width: 100%; height: 34px">
{{ countDown > 0 ? countDown + "秒后再次获取" : "发送验证码" }} {{ countDown > 0 ? countDown + "秒后再次获取" : "发送验证码" }}
</el-button> </el-button>
</div> </div>
...@@ -51,13 +55,20 @@ const countDownTimer = ref(null); ...@@ -51,13 +55,20 @@ const countDownTimer = ref(null);
const accountRef = ref(null); const accountRef = ref(null);
const emit = defineEmits(["action"]); const emit = defineEmits(["action"]);
const submitForm = async () => { const submitForm = () => {
if (!accountRef) return; if (!accountRef) return;
await accountRef.value.validate((valid, fields) => {
accountRef.value.validate((valid, fields) => {
if (valid) { if (valid) {
emit("action", accountForm); axios
} else { .post("/v1/api/user/forget/pwd/check", { phone: accountForm.phone, code: accountForm.code })
emit("action", null); .then(({ data }) => {
if (data.code == 200) {
emit("action", accountForm);
} else {
ElMessage.error(data.data);
}
});
} }
}); });
}; };
...@@ -73,7 +84,7 @@ const setForm = (data) => { ...@@ -73,7 +84,7 @@ const setForm = (data) => {
const getMsgCode = () => { const getMsgCode = () => {
if (accountForm.account) { 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) { if (data.code == 200) {
countDownAction(); countDownAction();
} else { } else {
...@@ -104,7 +115,7 @@ const phoneChange = () => { ...@@ -104,7 +115,7 @@ const phoneChange = () => {
if (accountForm.phone.length > 10) { if (accountForm.phone.length > 10) {
accountRef.value.validateField("phone").then((valid) => { accountRef.value.validateField("phone").then((valid) => {
if (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) { if (res.data.code == 200) {
accountForm.account = res.data.data || ""; accountForm.account = res.data.data || "";
} else { } else {
......
...@@ -53,10 +53,7 @@ ...@@ -53,10 +53,7 @@
ref="accountFromRef" ref="accountFromRef"
:form-type="route.query.id ? true : false" :form-type="route.query.id ? true : false"
@action="getAccountFromData"></accountFrom> @action="getAccountFromData"></accountFrom>
<passwordForm <passwordForm v-show="step === 2" ref="passwordFormRef" @action="getPasswordFormData"></passwordForm>
v-show="step === 2"
ref="passwordFormRef"
@action="getPasswordFormData"></passwordForm>
<div class="process_end" v-show="step === 3"> <div class="process_end" v-show="step === 3">
<div> <div>
<div> <div>
...@@ -120,7 +117,6 @@ const getAccountFromData = (data) => { ...@@ -120,7 +117,6 @@ const getAccountFromData = (data) => {
Object.assign(formData, data); Object.assign(formData, data);
step.value = 2; step.value = 2;
//校验手机号验证码 未出接口 //校验手机号验证码 未出接口
} else {
} }
}; };
//密码表单检验触发事件 data为null 校验失败 //密码表单检验触发事件 data为null 校验失败
...@@ -131,7 +127,7 @@ const getPasswordFormData = (data) => { ...@@ -131,7 +127,7 @@ const getPasswordFormData = (data) => {
phone: formData.phone, phone: formData.phone,
password: Encrypt(formData.new_password), 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) { if (res.data.code == 200) {
successFlag.value = true; successFlag.value = true;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment