diff --git a/public/static/admin.js b/public/static/admin.js index 18e775d8c..183766b3d 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -331,7 +331,7 @@ define('ThinkAdmin', function (require) { this.goto = function (url) { if (typeof url !== 'string' || url.length < 1) return; if (url.toLowerCase().indexOf('javascript:') === 0) { - return eval(url.split(':', 2)[1]); + return eval($.trim(url.substring(11))); } else { return location.href = url; } diff --git a/public/static/plugs/admin/validate.js b/public/static/plugs/admin/validate.js index 06ecdc588..43a46c8de 100644 --- a/public/static/plugs/admin/validate.js +++ b/public/static/plugs/admin/validate.js @@ -24,14 +24,14 @@ define(function () { this.evts = 'blur change'; // 预设检测规则 this.patterns = { + qq: '^[1-9][0-9]{4,11}$', + ip: '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$', + url: '^((https?|ftp|file):\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$', phone: '^1[3-9][0-9]{9}$', email: '^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$', - _qq_: '^[1-9][0-9]{4,11}$', - _ip_: '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$', - _url_: '^((https?|ftp|file):\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$', - _wechat_: '^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$', - _cardid_: '^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$', - _userame_: '^[a-zA-Z0-9_-]{4,16}$', + wechat: '^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$', + cardid: '^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$', + userame: '^[a-zA-Z0-9_-]{4,16}$', }; // 检测属性是否有定义 this.hasProp = function (el, prop) {