wl
2022-12-20 58aebf343084d71f0db27287c645c14400f8cb6d
src/views/systemSetting/baseSetting/user/components/password/index.vue
@@ -3,15 +3,15 @@
        <el-form ref="pwd" label-width="140px" autoComplete="on" :model="user" :rules="passrules">
            <!-- 初始密码 -->
            <el-form-item class="optionItem" label="初始密码:" prop="password">
                <el-input v-model="user.password" type="password" placeholder="请填写初始密码"></el-input>
                <el-input v-model="user.password" type="password" placeholder="请填写初始密码"  show-password></el-input>
            </el-form-item>
            <!-- 新密码 -->
            <el-form-item class="optionItem" label="新密码:" prop="newPwd">
                <el-input v-model="user.newPwd" type="password" placeholder="请填写新密码"></el-input>
                <el-input v-model="user.newPwd" type="password" placeholder="请填写新密码"  show-password></el-input>
            </el-form-item>
            <!-- 新密码 -->
            <el-form-item class="optionItem" label="确认新密码:" prop="secondPwd">
                <el-input v-model="user.secondPwd" type="password" placeholder="确认您的新密码"></el-input>
                <el-input v-model="user.secondPwd" type="password" placeholder="确认您的新密码"  show-password></el-input>
            </el-form-item>
        </el-form>
@@ -32,24 +32,21 @@
            }
        }
        const checkNewPwd = (rule, value, callback) => {
            if (!value) {
                callback(new Error('新密码不能为空'))
            } else if (value === this.user.password) {
                callback(new Error('新密码不能和旧密码一样'))
            } else {
                callback();
            }
        }
          var rep =/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$/;
          if (!rep.test(value) ) {
            callback(new Error("密码长度8到16位且密码中的字符必须包含字母大写和字母小写和必须包含数字,不能包含空格"));
          } else {
            callback();
          }
    };
        const checkSame = (rule, value, callback) => {
            if (!value) {
                callback(new Error('确认密码不能为空'))
            } else if (value !== this.user.newPwd) {
                console.log(111);
                callback(new Error('您输入的两次密码结果不同'));
            } else {
                callback();
            }
            var rep =/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$/;
          if (!rep.test(value) ) {
            callback(new Error("密码长度8到16位且密码中的字符必须包含字母大写和字母小写和必须包含数字,不能包含空格"));
          } else {
            callback();
          }
        }
        return {
            user: {