mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-02-17 15:59:41 +08:00
服务器创建名字检测
This commit is contained in:
parent
e6e094a45b
commit
0fe788f06a
@ -91,4 +91,10 @@
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + new Date(Date.now() + 10000 * 60 * 60 * 4).toGMTString();
|
||||
}
|
||||
|
||||
//判断是否是一个 标准字符串(标准的定义:仅有字母数字下划线)
|
||||
TOOLS.isStdText = function (text) {
|
||||
var reg = /^[A-Za-z0-9_]*$/igm;
|
||||
return reg.test(text);
|
||||
}
|
||||
|
||||
})();
|
@ -102,6 +102,10 @@
|
||||
methods: {
|
||||
toCreateServer: function () {
|
||||
var addCmdList = this.addCmd.split(' ');
|
||||
if (!TOOLS.isStdText(this.name)) {
|
||||
TOOLS.pushMsgWindow("服务器名字不合法!仅限字母数字下划线!");
|
||||
return;
|
||||
}
|
||||
var obj = {
|
||||
addCmd: addCmdList,
|
||||
serverName: this.name,
|
||||
|
Loading…
Reference in New Issue
Block a user