|
@@ -158,8 +158,17 @@ const validatePassword = (rule, value, callback) => {
|
|
callback()
|
|
callback()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+const passwordValValidate = (rule, value, callback) => {
|
|
|
|
+ if (!value) {
|
|
|
|
+ return callback(new Error('请输入新密码'))
|
|
|
|
+ } else if (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[._~!@#$^&*])[A-Za-z0-9._~!@#$^&*]{8,16}$/g.test(value)) {
|
|
|
|
+ return callback()
|
|
|
|
+ } else {
|
|
|
|
+ return callback(new Error('请输入包含英文字母大小写、数字和特殊符号的 8-16 位组合'))
|
|
|
|
+ }
|
|
|
|
+}
|
|
const rules = reactive({
|
|
const rules = reactive({
|
|
- password: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
|
|
|
|
|
|
+ password: [{ required: true, validator: passwordValValidate, trigger: 'blur' }],
|
|
refpassword: [{ required: true, validator: validatePassword, trigger: 'blur' }]
|
|
refpassword: [{ required: true, validator: validatePassword, trigger: 'blur' }]
|
|
})
|
|
})
|
|
const rules1 = reactive({
|
|
const rules1 = reactive({
|
|
@@ -243,9 +252,9 @@ const disabledVerify = computed(() => {
|
|
if (verify.count < 60) return true
|
|
if (verify.count < 60) return true
|
|
else {
|
|
else {
|
|
const type = select.value === '1' ? 'phone' : 'email'
|
|
const type = select.value === '1' ? 'phone' : 'email'
|
|
- const val = get(form,`value.${type}`)
|
|
|
|
- if(val) return false;
|
|
|
|
- else return true;
|
|
|
|
|
|
+ const val = get(form, `value.${type}`)
|
|
|
|
+ if (val) return false
|
|
|
|
+ else return true
|
|
}
|
|
}
|
|
})
|
|
})
|
|
const getVerifyCode = async () => {
|
|
const getVerifyCode = async () => {
|