From 705f7559e865aad6876e79abb42f9625947e6a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 20 Feb 2023 15:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=20ThinkPlugsStatic=20?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin.js | 2 +- public/static/plugs/admin/validate.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) 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) {