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

修改密码接口联调

parent 6c34a2b3
......@@ -16,7 +16,11 @@
<div class="msg-code">
<el-input v-model="accountForm.code" placeholder="请输入" style="860px"> </el-input>
<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 + "秒后再次获取" : "发送验证码" }}
</el-button>
</div>
......@@ -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) {
axios
.post("/v1/api/user/forget/pwd/check", { phone: accountForm.phone, code: accountForm.code })
.then(({ data }) => {
if (data.code == 200) {
emit("action", accountForm);
} else {
emit("action", null);
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 {
......
......@@ -53,10 +53,7 @@
ref="accountFromRef"
:form-type="route.query.id ? true : false"
@action="getAccountFromData"></accountFrom>
<passwordForm
v-show="step === 2"
ref="passwordFormRef"
@action="getPasswordFormData"></passwordForm>
<passwordForm v-show="step === 2" ref="passwordFormRef" @action="getPasswordFormData"></passwordForm>
<div class="process_end" v-show="step === 3">
<div>
<div>
......@@ -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 {
......
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