mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-15 05:10:47 +08:00
fix: 修改环境域名的正则条件
This commit is contained in:
parent
1eba042d17
commit
3ebf37ec82
@ -266,16 +266,16 @@ class ProjectMessage extends Component {
|
||||
validator(rule, value, callback) {
|
||||
if (value) {
|
||||
if (value.length === 0) {
|
||||
callback('请输入环境域名');
|
||||
} else if (!/\S/.test(value)) {
|
||||
callback('请输入环境域名');
|
||||
} else if (!/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/.test(value)) {
|
||||
callback('域名格式错误');
|
||||
callback('请输入环境域名!');
|
||||
} else if (/\s/.test(value)) {
|
||||
callback('环境域名不允许出现空格!');
|
||||
} else if (/\//.test(value)) {
|
||||
callback('环境域名不允许出现‘\/’!');
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
} else {
|
||||
callback('请输入环境域名');
|
||||
callback('请输入环境域名!');
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
Loading…
Reference in New Issue
Block a user