MrShi
2025-12-17 6b01dc5747fcab6de513a91cc79a8985e0cdc4d2
admin/src/components/common/CommonHeader.vue
@@ -21,8 +21,8 @@
              </div>
          </div>
          <div class="user-images">
              <img src="@/assets/icons/ic_1.jpg" alt="">
              <img src="@/assets/icons/ic_2.png" alt="">
<!--              <img src="@/assets/icons/ic_1.jpg" alt="">-->
<!--              <img src="@/assets/icons/ic_2.png" alt="">-->
              <img src="@/assets/icons/ic_3.jpg" alt="">
              <img src="@/assets/icons/ic_4.jpg" alt="">
              <img src="@/assets/icons/ic_5.jpg" alt="">
@@ -65,7 +65,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="请输入新密码,至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数"
          <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="请输入新密码,密码需包含字母、数字及特殊字符中的至少两种"
            maxlength="20" show-password></el-input>
        </el-form-item>
        <!-- <div style="font-size: 12px;color:#999999">密码需包含字母、数字及特殊字符中的至少两种</div> -->
@@ -96,6 +96,7 @@
    return {
      title: process.env.VUE_APP_TITLE,
      headerNavData: {},
      currentIndex: 0,
      visible: {
        // 修改密码
        changePwd: false
@@ -128,7 +129,7 @@
    }
  },
  computed: {
    ...mapState(['menuData', 'userInfo', 'topMenuList', 'currentIndex'])
    ...mapState(['menuData', 'userInfo', 'topMenuList'])
    // title () {
    //   return this.$route.meta.title
    // }
@@ -155,7 +156,7 @@
    }
  },
  methods: {
    ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent', 'setCurrentIndex']),
    ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent']),
    // 修改密码
    changePwd () {
      this.visible.changePwd = true
@@ -167,34 +168,24 @@
      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('密码需包含字母、数字及特殊字符中的至少两种'))
        // } 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()
        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(new Error('至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数'))
          callback() // 验证通过
        }
      }
    },
    getHeaderNav (item,index) {
      this.setCurrentIndex(index)
      this.currentIndex = index
      if(item.linkType === 0){
        this.setTopMenuCurrent(item)
      }else{
@@ -209,9 +200,9 @@
      getAppHeaderNav(type).then(res => {
        if (label === '安防中心') {
          let openWindow = window.open(res, '_blank')
          setTimeout(() => {
            openWindow.close()
          }, 7 * 1000)
          // setTimeout(() => {
          //   openWindow.close()
          // }, 7 * 1000)
        } else {
          window.open(res, '_blank')
        }
@@ -334,7 +325,7 @@
@import "@/assets/style/variables.scss";
.common-header {
  background-color: #2080f7;
  background-color: #1E7FFF;
}
.list {
@@ -344,14 +335,14 @@
    display: flex;
    align-items: center;
    .item {
      margin-right: 40px;
      margin-right: 24px;
      font-size: 16px;
      font-weight: 400;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      height: 40px;
      height: 49px;
      cursor: pointer;
      .linellae {
@@ -484,9 +475,9 @@
        align-items: center;
        img {
            top: 0 !important;
            width: 24px;
            height: 24px;
            margin-right: 15px;
            width: 20px;
            height: 20px;
            margin-right: 12px;
        }
    }
    .el-dropdown {