From 721ec9ce459204c5b37f321417116107c7a6e3c2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-M4V1LH5\\Jin" Date: Tue, 19 Mar 2019 22:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COMCMS.Common/Utils.cs | 15 +++++++++++- .../AdminCP/Views/Article/AddArticle.cshtml | 3 +++ .../AdminCP/Views/Article/EditArticle.cshtml | 3 +++ .../AdminCP/Views/Shared/_CommonLayout.cshtml | 24 +++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/COMCMS.Common/Utils.cs b/COMCMS.Common/Utils.cs index 75fb6ac..d97724b 100644 --- a/COMCMS.Common/Utils.cs +++ b/COMCMS.Common/Utils.cs @@ -177,7 +177,7 @@ namespace COMCMS.Common { if (str.Length != 11) return false; - return Regex.IsMatch(str, @"^1[3|4|5|7|8][0-9]\d{4,8}$"); + return Regex.IsMatch(str, @"^1[3|4|5|7|8|9][0-9]\d{4,8}$"); } /// /// 是否为ip @@ -308,6 +308,19 @@ namespace COMCMS.Common #endregion #region 获取部分 + + /// + /// 获取配置 + /// + /// 路径,如:SystemSetting:COMCMSPrefixKey + /// + public static string GetSetting(string path) + { + string value = Configuration[path]; + + return value; + } + /// /// 返回字符串真实长度, 1个汉字长度为2 /// diff --git a/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml index a3d1aea..75cbdad 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml @@ -110,6 +110,9 @@
+ + +
diff --git a/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml index 61a7a4c..8b1632a 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml @@ -109,6 +109,9 @@
+ + +
diff --git a/COMCMS.Web/Areas/AdminCP/Views/Shared/_CommonLayout.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Shared/_CommonLayout.cshtml index f55c23d..5a53f34 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Shared/_CommonLayout.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Shared/_CommonLayout.cshtml @@ -81,6 +81,30 @@ checkboxClass: 'icheckbox_square-green', radioClass: 'iradio_square-green', }); + $(".my-preview").click(function () { + var url = $(this).siblings(".upload-path").val(); + if (url) { + var data = { + "status": 1, + "msg": "", + "title": "预览图片", + "id": 1, + "start": 0, + "data": [ + { + "alt": "", + "pid": 1, + "src": url, + "thumb": "" + } + ] + }; + layer.photos({ + photos: data, + anim: 0 + }); + } + }) }) $("input").each(function (index, item) { if ($(this).attr("placeholder") && $(this).attr("placeholder") != "") {