密码禁止粘贴

This commit is contained in:
zhaoxiao
2021-10-11 14:37:26 +08:00
parent 5f9edf5b5d
commit f014d81327
3 changed files with 39 additions and 11 deletions
+23 -9
View File
@@ -11,26 +11,36 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<!-- <a-form-item-->
<!-- :labelCol="labelCol"-->
<!-- :wrapperCol="wrapperCol"-->
<!-- label="旧密码">-->
<!-- <a-input type="password" placeholder="请输入旧密码" v-decorator="[ 'oldpassword', validatorRules.oldpassword]"/>-->
<!-- </a-form-item>-->
<!-- <a-form-item-->
<!-- :labelCol="labelCol"-->
<!-- :wrapperCol="wrapperCol"-->
<!-- label="旧密码">-->
<!-- <a-input type="password" placeholder="请输入旧密码" v-decorator="[ 'oldpassword', validatorRules.oldpassword]"/>-->
<!-- </a-form-item>-->
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="新密码">
<a-input type="password" placeholder="请输入新密码" v-decorator="[ 'password', validatorRules.password]"/>
<a-input
type="password"
placeholder="请输入新密码"
@paste.native.capture.prevent="handleOperate"
autocomplete="false"
v-decorator="[ 'password', validatorRules.password]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="确认新密码">
<a-input type="password" @blur="handleConfirmBlur" placeholder="请确认新密码"
v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>
<a-input
type="password"
@blur="handleConfirmBlur"
placeholder="请确认新密码"
@paste.native.capture.prevent="handleOperate"
autocomplete="false"
v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>
</a-form-item>
</a-form>
@@ -166,6 +176,10 @@ export default {
getRSAPublicKey().then(res => {
this.rsaPublicKey = res.result
})
},
// 密码禁止粘贴
handleOperate() {
return false
}
}
}
+8 -1
View File
@@ -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="请输入验证码">
<a-icon slot="prefix" type="safety" :style="{ color: '#B3B7C2',fontSize:'20px'}"/>
</a-input>
@@ -88,6 +90,7 @@
size="large"
v-decorator="['captcha', { rules: validatorRules.captcha.rules,validateTrigger: 'blur'}]"
type="text"
autocomplete="false"
placeholder="请输入验证码">
<a-icon slot="prefix" type="safety" :style="{ color: '#B3B7C2',fontSize:'20px'}"/>
</a-input>
@@ -405,6 +408,10 @@ export default {
})
}
})
},
// 密码禁止粘贴
handleOperate() {
return false
}
}
}
+8 -1
View File
@@ -36,7 +36,7 @@
<a-input
v-decorator="['captcha', { rules: validatorRules.captcha.rules}]"
type="text"
autocomplete="off"
autocomplete="false"
placeholder="验证码">
</a-input>
<a-button
@@ -58,6 +58,8 @@
<a-input
placeholder="新密码"
v-decorator="['password', { rules: validatorRules.password.rules}]"
@paste.native.capture.prevent="handleOperate"
autocomplete="false"
type="password">
</a-input>
</a-form-item>
@@ -74,6 +76,7 @@
placeholder="确认密码"
v-decorator="['confirmPassword', { rules: validatorRules.confirmPassword.rules}]"
type="password"
@paste.native.capture.prevent="handleOperate"
autocomplete="false">
</a-input>
</a-form-item>
@@ -262,6 +265,10 @@ export default {
getRSAPublicKey().then(res => {
this.rsaPublicKey = res.result
})
},
// 密码禁止粘贴
handleOperate() {
return false
}
}
}