diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 5aea53cc..468f4b66 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -456,10 +456,12 @@ export default { }, // 输入框输入事件 setPassword(val) { + console.log(val) if (this.isShowPassword) { this.loginForm.password = val } 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 index = -1 // 新输入的字符位置 let lastChar = void 0 // 新输入的字符 @@ -475,25 +477,31 @@ export default { } }) // 判断输入的字符是否符合规范,不符合的话去掉该字符 - if (lastChar && !reg.test(lastChar)) { - coverArr.splice(index, 1) - this.pwdCover = coverArr.join('') - return - } - if (realLen < coverLen) { - // 新增字符 - realArr.splice(index, 0, lastChar) - } else if (coverLen <= realLen && index !== -1) { - // 替换字符(选取一个或多个字符直接替换) - realArr.splice(index, realLen - (coverLen - 1), lastChar) - } else { - // 删除字符,因为 val 全是 ● ,没有办法匹配,不知道是从末尾还是中间删除的字符,删除了几个,不好对 password 处理,所以可以通过光标的位置和 val 的长度来判断 - let pos = document.getElementById('pwd').selectionEnd // 获取光标位置 - realArr.splice(pos, realLen - coverLen) + // if (lastChar && !reg.test(lastChar)) { + // coverArr.splice(index, 1) + // this.pwdCover = coverArr.join('') + // console.log(111111111111111, lastChar) + // // return + // } + if (coverLen - realLen <= 2) { + if (realLen < coverLen) { + // 新增字符 + realArr.splice(index, 0, lastChar) + } else if (coverLen <= realLen && index !== -1) { + // 替换字符(选取一个或多个字符直接替换) + realArr.splice(index, realLen - (coverLen - 1), lastChar) + } else { + // 删除字符,因为 val 全是 ● ,没有办法匹配,不知道是从末尾还是中间删除的字符,删除了几个,不好对 password 处理,所以可以通过光标的位置和 val 的长度来判断 + let pos = document.getElementById('pwd').selectionEnd // 获取光标位置 + realArr.splice(pos, realLen - coverLen) + } } + // 将 pwdCover 替换成 ● 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('') } }, // 点击右侧小眼睛控制显示隐藏 diff --git a/src/views/reviewers/curriculumVitae/components/info/info.vue b/src/views/reviewers/curriculumVitae/components/info/info.vue index ff940e23..894ad28e 100644 --- a/src/views/reviewers/curriculumVitae/components/info/info.vue +++ b/src/views/reviewers/curriculumVitae/components/info/info.vue @@ -494,11 +494,13 @@ export default { openEdit() { this.form = defaultForm() 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.model_cfg.visible = true + console.log(this.form) + console.log(this.DATA) }, handleCancle() { this.form = defaultForm() diff --git a/src/views/trials/trials-myinfo/index.vue b/src/views/trials/trials-myinfo/index.vue index 869f4ddb..b158a80e 100644 --- a/src/views/trials/trials-myinfo/index.vue +++ b/src/views/trials/trials-myinfo/index.vue @@ -73,7 +73,7 @@ export default { } let id = await this.useUserIDGetDoctorID() 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') } else {