用户名不能包含空格校验

This commit is contained in:
谢思 2023-04-13 14:06:11 +08:00
parent b166b1a51c
commit 952b4c2da0
1 changed files with 5 additions and 1 deletions

View File

@ -71,7 +71,7 @@ function Register(props){
type: 1
}).then(response => {
if (response.data.status === -1) {
callback('该名称已经被使用');
callback(response.data.message);
} else {
setLoginStr(value);
setUserNameGo(false);
@ -250,6 +250,10 @@ function Register(props){
pattern: /[a-zA-Z0-9]$/,
message: "用户名只能使用英文字母和数字"
},
{
pattern: /^\s*$/,
message: "用户名不能包含空格"
},
{
min: 4,
max: 15,