diff --git a/COMCMS.Common/COMCMS.Common.csproj b/COMCMS.Common/COMCMS.Common.csproj index 4633556..bf89b60 100644 --- a/COMCMS.Common/COMCMS.Common.csproj +++ b/COMCMS.Common/COMCMS.Common.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/COMCMS.Core/COMCMS.Core.csproj b/COMCMS.Core/COMCMS.Core.csproj index 9017645..2cbe1ec 100644 --- a/COMCMS.Core/COMCMS.Core.csproj +++ b/COMCMS.Core/COMCMS.Core.csproj @@ -5,7 +5,7 @@ - + diff --git a/COMCMS.Core/Core/广告详情.Biz.cs b/COMCMS.Core/Core/广告详情.Biz.cs index b38de1c..a1649cf 100644 --- a/COMCMS.Core/Core/广告详情.Biz.cs +++ b/COMCMS.Core/Core/广告详情.Biz.cs @@ -305,11 +305,7 @@ namespace COMCMS.Core { Ads model = new Ads(); model = Find(_.Id == aid); - if (model == null) - { - return null; - } - if (model.TId == 4) + if (model!=null && model.TId == 4) { List listimg = new List(); listimg = JsonConvert.DeserializeObject>(model.Content); diff --git a/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml index 757bb41..a3d1aea 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml @@ -19,7 +19,7 @@ diff --git a/COMCMS.Web/COMCMS.Web.csproj b/COMCMS.Web/COMCMS.Web.csproj index 494a446..386ba3c 100644 --- a/COMCMS.Web/COMCMS.Web.csproj +++ b/COMCMS.Web/COMCMS.Web.csproj @@ -1,22 +1,22 @@  - netcoreapp2.1 + netcoreapp2.2 - - - + + + - + - + - - + + diff --git a/COMCMS.Web/Controllers/api/ArticleController.cs b/COMCMS.Web/Controllers/api/ArticleController.cs index 262077c..48be6e8 100644 --- a/COMCMS.Web/Controllers/api/ArticleController.cs +++ b/COMCMS.Web/Controllers/api/ArticleController.cs @@ -11,7 +11,6 @@ using XCode; using System.Web; using COMCMS.Web.Filter; using NewLife.Log; -using static COMCMS.Web.Models.APIModels; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Senparc.Weixin.WxOpen; diff --git a/COMCMS.Web/Controllers/api/ProductController.cs b/COMCMS.Web/Controllers/api/ProductController.cs index e2df8fe..6c142f7 100644 --- a/COMCMS.Web/Controllers/api/ProductController.cs +++ b/COMCMS.Web/Controllers/api/ProductController.cs @@ -11,7 +11,6 @@ using XCode; using System.Web; using COMCMS.Web.Filter; using NewLife.Log; -using static COMCMS.Web.Models.APIModels; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Senparc.Weixin.WxOpen; diff --git a/COMCMS.Web/Controllers/api/UserController.cs b/COMCMS.Web/Controllers/api/UserController.cs index af06165..1f9d664 100644 --- a/COMCMS.Web/Controllers/api/UserController.cs +++ b/COMCMS.Web/Controllers/api/UserController.cs @@ -11,10 +11,10 @@ using XCode; using System.Web; using COMCMS.Web.Filter; using NewLife.Log; -using static COMCMS.Web.Models.APIModels; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Senparc.Weixin.WxOpen; +using COMCMS.Web.Models; namespace COMCMS.Web.Controllers.api { diff --git a/COMCMS.Web/Filter/CheckFilter.cs b/COMCMS.Web/Filter/CheckFilter.cs index 738175d..4b6fbae 100644 --- a/COMCMS.Web/Filter/CheckFilter.cs +++ b/COMCMS.Web/Filter/CheckFilter.cs @@ -120,7 +120,7 @@ namespace COMCMS.Web.Filter string timeStamp = pars["timeStamp"]; //判断时间有效性 DateTime postTime = Utils.StampToDateTime(timeStamp); - if (postTime < DateTime.Now.AddSeconds(-120))//30秒有效期 + if (postTime < DateTime.UtcNow.AddSeconds(-120))//30秒有效期 { return new ReJson(40004, "signature 错误!", 1); } diff --git a/COMCMS.Web/Models/APIModels.cs b/COMCMS.Web/Models/APIModels.cs index e899a0a..94948c7 100644 --- a/COMCMS.Web/Models/APIModels.cs +++ b/COMCMS.Web/Models/APIModels.cs @@ -5,57 +5,104 @@ using System.Threading.Tasks; namespace COMCMS.Web.Models { - public class APIModels + #region 修改我的个人资料Model + public class APIModMyInfo { - #region 修改我的个人资料Model - public class APIModMyInfo - { - public string RealName { get; set; } - public string Tel { get; set; } - public string Weixin { get; set; } - public string Alipay { get; set; } - public string BankCardNO { get; set; } - public string Bank { get; set; } - public string SessionKey { get; set; } - } - #endregion - - #region 小程序获得用户信息 - /// - /// 小程序获得用户信息 - /// - public class WXAppUserInfo - { - /// - /// 用户名 - /// - public string nickName { get; set; } - /// - /// 性别 0 未知,1 男,2女 - /// - public int gender { get; set; } - /// - /// 语言 - /// - public string language { get; set; } - /// - /// 城市 - /// - public string city { get; set; } - /// - /// 省份 - /// - public string province { get; set; } - /// - /// 国家 - /// - public string country { get; set; } - /// - /// 用户头像 - /// - public string avatarUrl { get; set; } - } - - #endregion + public string RealName { get; set; } + public string Tel { get; set; } + public string Weixin { get; set; } + public string Alipay { get; set; } + public string BankCardNO { get; set; } + public string Bank { get; set; } + public string SessionKey { get; set; } } + #endregion + + #region 小程序获得用户信息 + /// + /// 小程序获得用户信息 + /// + public class WXAppUserInfo + { + /// + /// 用户名 + /// + public string nickName { get; set; } + /// + /// 性别 0 未知,1 男,2女 + /// + public int gender { get; set; } + /// + /// 语言 + /// + public string language { get; set; } + /// + /// 城市 + /// + public string city { get; set; } + /// + /// 省份 + /// + public string province { get; set; } + /// + /// 国家 + /// + public string country { get; set; } + /// + /// 用户头像 + /// + public string avatarUrl { get; set; } + } + + #endregion + + #region 通用返回信息 + public class ReJson + { + public ReJson(string message) + { + this.message = message; + code = 0; + } + + public ReJson(int code, string message) + { + this.code = code; + this.message = message; + } + + public ReJson(int code, string message, int isReload) + { + this.code = code; + this.message = message; + this.isReload = isReload; + } + + public ReJson(int code, string message, object detail) + { + this.code = code; + this.message = message; + this.detail = detail; + } + + /// + /// 返回代码 0 为正确 + /// + public int code { get; set; } = 40000; + + /// + /// 提示语 + /// + public string message { get; set; } + /// + /// 是否重新加载 + /// + public int isReload { get; set; } = 0; + + /// + /// 数据详情 object + /// + public object detail { get; set; } + } + #endregion } diff --git a/COMCMS.Web/Startup.cs b/COMCMS.Web/Startup.cs index 4451f8d..68b9df2 100644 --- a/COMCMS.Web/Startup.cs +++ b/COMCMS.Web/Startup.cs @@ -73,7 +73,7 @@ namespace COMCMS.Web //部分系统配置 services.Configure(Configuration.GetSection("SystemSetting")); - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); ; + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); ; //防止汉字被自动编码 services.Configure(options => { diff --git a/COMCMS.Web/Views/Home/Index.cshtml b/COMCMS.Web/Views/Home/Index.cshtml index 81581cd..709e806 100644 --- a/COMCMS.Web/Views/Home/Index.cshtml +++ b/COMCMS.Web/Views/Home/Index.cshtml @@ -6,7 +6,6 @@ ViewBag.description = cfg.Description; Article about = ViewBag.about; - IList listLinks = Link.FindAll(Link._.KId == 1, Link._.Sequence.Asc(), null, 0, 0); //处理bannr广告 @@ -18,11 +17,16 @@ @@ -266,13 +280,14 @@
- @{ - IList
listNews1 = Article.FindAll(Article._.KId == 6, Article._.Sequence.Asc(), null, 0, 4); - } -
- - @if (listNews1.Count > 0) - { + @{ + IList
listNews1 = Article.FindAll(Article._.KId == 6, Article._.Sequence.Asc(), null, 0, + 4); + } +
+ + @if (listNews1.Count > 0) + { - } - + } + +
+ -
- - @{ - IList
listNews2 = Article.FindAll(Article._.KId == 7, Article._.Sequence.Asc(), null, 0, 4); - } - @if (listNews2.Count > 0) - { - - } - - -
+ } +
+
@@ -431,17 +445,17 @@
@foreach (var l in listLinks) { -
- -
+
+ +
} - +
@@ -451,26 +465,27 @@