bug: 🐛 重复用户名校验
This commit is contained in:
parent
a2d24b9492
commit
2f8937ae13
@ -164,13 +164,14 @@ const validate = async (_rule: Rule, value: string) => {
|
|||||||
const regex = /^[a-zA-Z0-9]{4,8}$/
|
const regex = /^[a-zA-Z0-9]{4,8}$/
|
||||||
if (!regex.test(value)) {
|
if (!regex.test(value)) {
|
||||||
return Promise.reject('用户名只能是4-8位字母或数字')
|
return Promise.reject('用户名只能是4-8位字母或数字')
|
||||||
} else {
|
}
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
api.aclApi.user.existName({ name: value }, (data) => {
|
api.aclApi.user.existName({ name: value }, (data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
return Promise.reject('用户名已经存在')
|
reject('用户名已经存在')
|
||||||
} else {
|
} else {
|
||||||
return Promise.resolve()
|
resolve(data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,8 @@ export default defineConfig(({ mode }) => {
|
|||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'https://ims.riemann.tech/api/',
|
target: 'https://ims.riemann.tech/api/',
|
||||||
target: 'http://127.0.0.1:8888',
|
// target: 'http://127.0.0.1:8888',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user