doum
14 小时以前 2ba20a79dacdbde2d7fd2ebc1fc45ed9bbd8bcbd
admin/src/components/common/CommonHeader.vue
@@ -35,7 +35,7 @@
            show-password></el-input>
        </el-form-item>
        <el-form-item label="新密码" prop="newPwd" required>
          <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="请输入新密码,密码需包含字母、数字及特殊字符中的至少两种"
          <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="请输入新密码,至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数"
            maxlength="20" show-password></el-input>
        </el-form-item>
        <!-- <div style="font-size: 12px;color:#999999">密码需包含字母、数字及特殊字符中的至少两种</div> -->
@@ -112,6 +112,18 @@
    if (this.userInfo && (!this.userInfo.needChangePwd || this.userInfo.needChangePwd == '0')) {
      this.visible.changePwd = true
    }
    const queryParams = new URLSearchParams(window.location.search);
    const param1 = queryParams.get('topmenu');
    console.log("============================param1=",param1,queryParams)
    var that = this
    if(param1 && this.topMenuList){
      this.topMenuList.list.forEach((item,index)=>{
        if(item.params && item.params === param1){
          that.getHeaderNav(item,index)
        }
      })
    }
  },
  filters: {
    // 展示名称
@@ -138,19 +150,29 @@
      if (!value) {
        callback(new Error('请输入密码'))
      } else {
        const lengthValid = /^.{6,20}$/.test(value)
        const hasLetter = /[a-zA-Z]/.test(value)
        const hasNumber = /[0-9]/.test(value)
        const hasSpecial = /[!@#$%^&*(),.?":{}|<>]/.test(value)
        const typesCount = [hasLetter, hasNumber, hasSpecial].filter(Boolean).length
        if (!lengthValid) {
          callback(new Error('密码长度需为6到20个字符'))
        } else if (typesCount < 2) {
          callback(new Error('密码需包含字母、数字及特殊字符中的至少两种'))
        // const lengthValid = /^.{6,20}$/.test(value)
        // const hasLetter = /[a-zA-Z]/.test(value)
        // const hasNumber = /[0-9]/.test(value)
        // const hasSpecial = /[!@#$%^&*(),.?":{}|<>]/.test(value)
        //
        // const typesCount = [hasLetter, hasNumber, hasSpecial].filter(Boolean).length
        //
        // if (!lengthValid) {
        //   callback(new Error('密码长度需为6到20个字符'))
        // } else if (typesCount < 2) {
        //   callback(new Error('密码需包含字母、数字及特殊字符中的至少两种'))
        // } else {
        //   callback() // 验证通过
        // }
        let typeCount = 0;
        if (/[a-z]/.test(value)) typeCount++; // 小写字母
        if (/[A-Z]/.test(value)) typeCount++; // 大写字母
        if (/\d/.test(value)) typeCount++;    // 数字
        if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(value)) typeCount++; // 特殊字符
        if (typeCount >= 3) {
          callback()
        } else {
          callback() // 验证通过
          callback(new Error('至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数'))
        }
      }
    },