mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
fix: 修改环境域名的正则条件
This commit is contained in:
parent
ef7ebe7d18
commit
580f2d29b6
@ -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