mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 10:33:50 +08:00
fix: async validator (#3194)
This commit is contained in:
parent
4755017bcc
commit
405ef9e2b3
@ -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 || '验证失败');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user