bug修复
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
62d5b39036
commit
9bd6c1f433
|
@ -456,10 +456,12 @@ export default {
|
||||||
},
|
},
|
||||||
// 输入框输入事件
|
// 输入框输入事件
|
||||||
setPassword(val) {
|
setPassword(val) {
|
||||||
|
console.log(val)
|
||||||
if (this.isShowPassword) {
|
if (this.isShowPassword) {
|
||||||
this.loginForm.password = val
|
this.loginForm.password = val
|
||||||
} else {
|
} else {
|
||||||
let reg = /[0-9a-zA-Z]/g // 只允许输入字母和数字
|
let reg =
|
||||||
|
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[-_.@^+\$!%#*?&\$~])[A-Za-z0-9-~_.@^+\$~!%#*?&]{8,32}$/g // 只允许输入字母和数字
|
||||||
let nDot = /[^●]/g // 非圆点字符
|
let nDot = /[^●]/g // 非圆点字符
|
||||||
let index = -1 // 新输入的字符位置
|
let index = -1 // 新输入的字符位置
|
||||||
let lastChar = void 0 // 新输入的字符
|
let lastChar = void 0 // 新输入的字符
|
||||||
|
@ -475,25 +477,31 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 判断输入的字符是否符合规范,不符合的话去掉该字符
|
// 判断输入的字符是否符合规范,不符合的话去掉该字符
|
||||||
if (lastChar && !reg.test(lastChar)) {
|
// if (lastChar && !reg.test(lastChar)) {
|
||||||
coverArr.splice(index, 1)
|
// coverArr.splice(index, 1)
|
||||||
this.pwdCover = coverArr.join('')
|
// this.pwdCover = coverArr.join('')
|
||||||
return
|
// console.log(111111111111111, lastChar)
|
||||||
}
|
// // return
|
||||||
if (realLen < coverLen) {
|
// }
|
||||||
// 新增字符
|
if (coverLen - realLen <= 2) {
|
||||||
realArr.splice(index, 0, lastChar)
|
if (realLen < coverLen) {
|
||||||
} else if (coverLen <= realLen && index !== -1) {
|
// 新增字符
|
||||||
// 替换字符(选取一个或多个字符直接替换)
|
realArr.splice(index, 0, lastChar)
|
||||||
realArr.splice(index, realLen - (coverLen - 1), lastChar)
|
} else if (coverLen <= realLen && index !== -1) {
|
||||||
} else {
|
// 替换字符(选取一个或多个字符直接替换)
|
||||||
// 删除字符,因为 val 全是 ● ,没有办法匹配,不知道是从末尾还是中间删除的字符,删除了几个,不好对 password 处理,所以可以通过光标的位置和 val 的长度来判断
|
realArr.splice(index, realLen - (coverLen - 1), lastChar)
|
||||||
let pos = document.getElementById('pwd').selectionEnd // 获取光标位置
|
} else {
|
||||||
realArr.splice(pos, realLen - coverLen)
|
// 删除字符,因为 val 全是 ● ,没有办法匹配,不知道是从末尾还是中间删除的字符,删除了几个,不好对 password 处理,所以可以通过光标的位置和 val 的长度来判断
|
||||||
|
let pos = document.getElementById('pwd').selectionEnd // 获取光标位置
|
||||||
|
realArr.splice(pos, realLen - coverLen)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将 pwdCover 替换成 ●
|
// 将 pwdCover 替换成 ●
|
||||||
this.pwdCover = val.replace(/\S/g, '●')
|
this.pwdCover = val.replace(/\S/g, '●')
|
||||||
this.loginForm.password = realArr.join('')
|
let v = val.replace(/●/g, '')
|
||||||
|
this.loginForm.password =
|
||||||
|
coverLen - realLen >= 2 ? realArr.join('') + v : realArr.join('')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 点击右侧小眼睛控制显示隐藏
|
// 点击右侧小眼睛控制显示隐藏
|
||||||
|
|
|
@ -494,11 +494,13 @@ export default {
|
||||||
openEdit() {
|
openEdit() {
|
||||||
this.form = defaultForm()
|
this.form = defaultForm()
|
||||||
Object.keys(this.form).forEach((key) => {
|
Object.keys(this.form).forEach((key) => {
|
||||||
if (this.DATA[key]) {
|
if (this.DATA[key] || this.DATA[key] == 0) {
|
||||||
this.form[key] = this.DATA[key]
|
this.form[key] = this.DATA[key]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.model_cfg.visible = true
|
this.model_cfg.visible = true
|
||||||
|
console.log(this.form)
|
||||||
|
console.log(this.DATA)
|
||||||
},
|
},
|
||||||
handleCancle() {
|
handleCancle() {
|
||||||
this.form = defaultForm()
|
this.form = defaultForm()
|
||||||
|
|
|
@ -73,7 +73,7 @@ export default {
|
||||||
}
|
}
|
||||||
let id = await this.useUserIDGetDoctorID()
|
let id = await this.useUserIDGetDoctorID()
|
||||||
const routeData = this.$router.resolve({
|
const routeData = this.$router.resolve({
|
||||||
path: `/curriculumVitae?id=${id}&&lang=${this.$i18n.locale}`,
|
path: `/curriculumVitae?Id=${id}&&lang=${this.$i18n.locale}`,
|
||||||
})
|
})
|
||||||
this.open = window.open(routeData.href, '_blank')
|
this.open = window.open(routeData.href, '_blank')
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue