|
@@ -18,14 +18,6 @@
|
|
|
label-width="100px"
|
|
|
>
|
|
|
<template v-if="needResetPwd">
|
|
|
- <el-form-item prop="oldPassword" label="旧密码:">
|
|
|
- <el-input
|
|
|
- type="password"
|
|
|
- v-model="modalForm.oldPassword"
|
|
|
- placeholder="请输入旧密码"
|
|
|
- clearable
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
<el-form-item prop="password" label="新密码:">
|
|
|
<el-input
|
|
|
type="password"
|
|
@@ -89,7 +81,7 @@
|
|
|
<script>
|
|
|
import { updatePwd } from "../api";
|
|
|
import { getSmsCodeForBind } from "@/modules/login/api";
|
|
|
-import { password, strictPassword, phone, smscode } from "@/plugins/formRules";
|
|
|
+import { strictPassword, phone, smscode } from "@/plugins/formRules";
|
|
|
import { Base64 } from "@/plugins/crypto";
|
|
|
import fetchSmsMixins from "@/modules/login/fetchSmsMixins";
|
|
|
|
|
@@ -132,13 +124,6 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
];
|
|
|
- const equalToOldPswd = (rule, value, callback) => {
|
|
|
- if (value === this.modalForm.oldPassword) {
|
|
|
- callback(new Error("新旧密码不可以相同"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- };
|
|
|
const equalToPswd = (rule, value, callback) => {
|
|
|
if (value !== this.modalForm.password) {
|
|
|
callback(new Error("两次输入的密码不一致"));
|
|
@@ -155,14 +140,7 @@ export default {
|
|
|
resetRules: {
|
|
|
code: smscode,
|
|
|
mobileNumber: phone,
|
|
|
- oldPassword: password,
|
|
|
- password: [
|
|
|
- ...passwordRule,
|
|
|
- {
|
|
|
- validator: equalToOldPswd,
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
+ password: [...passwordRule],
|
|
|
rePassword: [
|
|
|
...passwordRule,
|
|
|
{
|
|
@@ -251,11 +229,11 @@ export default {
|
|
|
this.isSubmit = true;
|
|
|
let datas = {
|
|
|
id: this.modalForm.id,
|
|
|
- oldPassword: Base64(this.modalForm.oldPassword),
|
|
|
};
|
|
|
if (this.needBindMobile) {
|
|
|
datas = {
|
|
|
...datas,
|
|
|
+ oldPassword: Base64(this.modalForm.oldPassword),
|
|
|
mobileNumber: this.modalForm.mobileNumber,
|
|
|
verifyCode: this.modalForm.code,
|
|
|
};
|