handleTextClick() {
const chars =
'ABCDEFGHIJKLMNOPQRSTUVWSYZabcdefghijklmnopqrstuvwsyz0123456789.@$!%*#_~?&^'
let pass = ''
const num = Math.floor(Math.random() * 13 + 8)
for (var i = 0; i < num; i++) {
const val = Math.round(Math.random() * 73)
pass += chars.charAt(val)
}
const reg = /^(?![A-Z]*$)(?![a-z]*$)(?![0-9]*$)(?![^a-zA-Z0-9]*$)\S+$/
if (reg.test(pass)) {
this.password = pass
this.$refs.addWin.clearValidate('password')
} else {
this.handleTextClick()
}
},
一键生成密码,大小写字母,数字,特殊字符两种以上
最新推荐文章于 2023-12-19 16:48:04 发布