diff --git a/src/components/tools/UserPassword.vue b/src/components/tools/UserPassword.vue index 0100bd1..ec5fa98 100644 --- a/src/components/tools/UserPassword.vue +++ b/src/components/tools/UserPassword.vue @@ -11,26 +11,36 @@ - - - - - - + + + + + + - + - + @@ -166,6 +176,10 @@ export default { getRSAPublicKey().then(res => { this.rsaPublicKey = res.result }) + }, + // 密码禁止粘贴 + handleOperate() { + return false } } } diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index ac220f5..40d4537 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -31,6 +31,7 @@ v-decorator="['password',{initialValue:'', rules: validatorRules.password.rules,validateTrigger: 'blur'}]" size="large" type="password" + @paste.native.capture.prevent="handleOperate" autocomplete="false" placeholder="请输入密码" > @@ -49,7 +50,8 @@ size="large" type="text" @change="inputCodeChange" - autocomplete="off" + @paste.native.capture.prevent="handleOperate" + autocomplete="false" placeholder="请输入验证码"> @@ -88,6 +90,7 @@ size="large" v-decorator="['captcha', { rules: validatorRules.captcha.rules,validateTrigger: 'blur'}]" type="text" + autocomplete="false" placeholder="请输入验证码"> @@ -405,6 +408,10 @@ export default { }) } }) + }, + // 密码禁止粘贴 + handleOperate() { + return false } } } diff --git a/src/views/user/alteration/Alteration.vue b/src/views/user/alteration/Alteration.vue index b227610..f4aeea1 100644 --- a/src/views/user/alteration/Alteration.vue +++ b/src/views/user/alteration/Alteration.vue @@ -36,7 +36,7 @@ @@ -74,6 +76,7 @@ placeholder="确认密码" v-decorator="['confirmPassword', { rules: validatorRules.confirmPassword.rules}]" type="password" + @paste.native.capture.prevent="handleOperate" autocomplete="false"> @@ -262,6 +265,10 @@ export default { getRSAPublicKey().then(res => { this.rsaPublicKey = res.result }) + }, + // 密码禁止粘贴 + handleOperate() { + return false } } }