| | |
| | | <div class="common-header"> |
| | | <div class="header"> |
| | | <div class="logo"> |
| | | <div class="title">{{ title }}</div> |
| | | <div class="title"> <img src="@/assets/system.png" alt="" />{{ title }}</div> |
| | | <div class="list"> |
| | | <div :class="index==currentIndex?'item active':'item'" v-for="(item,index) in topMenuList.list" :key="item.id" @click="getHeaderNav(item,index)" :index="index">{{item.label}} |
| | | <div v-if="index==currentIndex" class="linellae"></div> |
| | |
| | | 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> --> |
| | |
| | | return { |
| | | title: process.env.VUE_APP_TITLE, |
| | | headerNavData: {}, |
| | | currentIndex: 0, |
| | | visible: { |
| | | // 修改密码 |
| | | changePwd: false |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(['menuData', 'userInfo', 'topMenuList']) |
| | | ...mapState(['menuData', 'userInfo', 'topMenuList', 'currentIndex']) |
| | | // title () { |
| | | // return this.$route.meta.title |
| | | // } |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent']), |
| | | ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent', 'setCurrentIndex']), |
| | | // 修改密码 |
| | | changePwd () { |
| | | this.visible.changePwd = true |
| | |
| | | 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位数')) |
| | | } |
| | | } |
| | | }, |
| | | getHeaderNav (item,index) { |
| | | this.currentIndex = index |
| | | this.setCurrentIndex(index) |
| | | if(item.linkType === 0){ |
| | | this.setTopMenuCurrent(item) |
| | | }else{ |
| | | if (item.url && item.url === 'goHKAF' && item.params != null) { |
| | | this.getHKAFHeaderNav(item.params) |
| | | this.getHKAFHeaderNav(item.params, item.label) |
| | | } else if (item.url && item.url.indexOf('http') === 0) { |
| | | window.open(item.url, '_blank') |
| | | } |
| | | } |
| | | }, |
| | | getHKAFHeaderNav (type) { |
| | | getHKAFHeaderNav (type, label) { |
| | | getAppHeaderNav(type).then(res => { |
| | | window.open(res, '_blank') |
| | | if (label === '安防中心') { |
| | | let openWindow = window.open(res, '_blank') |
| | | setTimeout(() => { |
| | | openWindow.close() |
| | | }, 7 * 1000) |
| | | } else { |
| | | window.open(res, '_blank') |
| | | } |
| | | }) |
| | | }, |
| | | handleTest () { |
| | |
| | | newPwd: this.changePwdData.form.newPwd |
| | | }) |
| | | .then(() => { |
| | | console.log('修改成功') |
| | | this.$tip.apiSuccess('修改成功') |
| | | this.$store.commit('setUserInfo', { needChangePwd: 1 }) |
| | | // this.$store.commit('setUserInfo', { needChangePwd: 1 }) |
| | | this.visible.changePwd = false |
| | | }) |
| | | .catch(e => { |
| | |
| | | box-sizing: border-box; |
| | | min-width: 360px; |
| | | height: 56px; |
| | | padding: 10px 30px; |
| | | padding: 10px 20px; |
| | | // flex-shrink: 0; |
| | | line-height: 36px; |
| | | font-size: 22px; |
| | |
| | | align-items: center; |
| | | |
| | | .title { |
| | | display: flex; |
| | | color: rgb(255, 255, 255); |
| | | font-size: 18px; |
| | | width: 320px; |
| | | font-weight: 700; |
| | | font-family: "Microsoft Yahei", "sans-serif", "segoe UI", "PingFang SC", arial, Helvetica; |
| | | //font-size: 18px; |
| | | //width: 320px; |
| | | img{ |
| | | width:auto ; |
| | | height: 32px; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | |
| | | // display: inline; |