测试禁止账号保存
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-11-01 11:23:35 +08:00
parent 96d2a99f17
commit 71f856029c
1 changed files with 72 additions and 1 deletions

View File

@ -83,7 +83,7 @@
<svg-icon icon-class="password" />
</span>
<!-- password -->
<el-input
<!-- <el-input
:key="passwordType"
ref="password"
v-model="loginForm.password"
@ -100,6 +100,21 @@
<svg-icon
:icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
/>
</span> -->
<el-input
:key="passwordType"
ref="password"
v-model="pwdCover"
size="small"
type="text"
:placeholder="$t('login:form:password')"
name="password"
@input="setPassword"
tabindex="2"
@keyup.enter.native="handleLogin"
/>
<span class="show-pwd" @click="hidePassword">
<svg-icon :icon-class="!isShowPassword ? 'eye' : 'eye-open'" />
</span>
</el-form-item>
<!-- Login -->
@ -276,6 +291,8 @@ export default {
},
loading: false,
passwordType: 'password',
pwdCover: null,
isShowPassword: false,
loginType: null,
location: null,
isShow: false,
@ -437,6 +454,60 @@ export default {
handleResetPwd() {
this.$router.push({ name: 'Resetpassword' })
},
//
setPassword(val) {
if (this.isShowPassword) {
this.loginForm.password = val
} else {
let reg = /[0-9a-zA-Z]/g //
let nDot = /[^●]/g //
let index = -1 //
let lastChar = void 0 //
let realArr = this.loginForm.password.split('') //
let coverArr = val.split('') //
let coverLen = val.length //
let realLen = this.loginForm.password.length //
//
coverArr.forEach((el, idx) => {
if (nDot.test(el)) {
index = idx
lastChar = el
}
})
//
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)
}
// pwdCover
this.pwdCover = val.replace(/\S/g, '●')
this.loginForm.password = realArr.join('')
}
},
//
hidePassword() {
if (!this.isShowPassword) {
// console.log("");
this.isShowPassword = true
this.pwdCover = this.loginForm.password
} else {
// console.log("");
this.isShowPassword = false
this.pwdCover = this.pwdCover.replace(/\S/g, '●')
}
},
},
}
</script>