bowen
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
2 deletions
-
src/views/demo/form/RuleForm.vue
-
src/views/demo/system/account/account.data.ts
|
|
@ -192,10 +192,12 @@ |
|
|
message: '请输入数据', |
|
|
message: '请输入数据', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
|
|
|
trigger: 'blur', |
|
|
validator(_, value) { |
|
|
validator(_, value) { |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
if (!value) return resolve(); |
|
|
isAccountExist(value) |
|
|
isAccountExist(value) |
|
|
.then(() => resolve()) |
|
|
.then(resolve) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
reject(err.message || '验证失败'); |
|
|
reject(err.message || '验证失败'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
@ -89,10 +89,12 @@ export const accountFormSchema: FormSchema[] = [ |
|
|
message: '请输入用户名', |
|
|
message: '请输入用户名', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
|
|
|
trigger: 'blur', |
|
|
validator(_, value) { |
|
|
validator(_, value) { |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
if (!value) return resolve(); |
|
|
isAccountExist(value) |
|
|
isAccountExist(value) |
|
|
.then(() => resolve()) |
|
|
.then(resolve) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
reject(err.message || '验证失败'); |
|
|
reject(err.message || '验证失败'); |
|
|
}); |
|
|
}); |
|
|
|