bug: 🐛 打包报错
This commit is contained in:
parent
2f8937ae13
commit
88795fe559
@ -160,17 +160,17 @@ export const formItems = (sexes: Codebook[]): FormItem[] => {
|
||||
]
|
||||
}
|
||||
|
||||
const validate = async (_rule: Rule, value: string) => {
|
||||
const validate = async (_rule: Rule, value: string): Promise<void> => {
|
||||
const regex = /^[a-zA-Z0-9]{4,8}$/
|
||||
if (!regex.test(value)) {
|
||||
return Promise.reject('用户名只能是4-8位字母或数字')
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
api.aclApi.user.existName({ name: value }, (data) => {
|
||||
if (data) {
|
||||
reject('用户名已经存在')
|
||||
} else {
|
||||
resolve(data)
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user