修复设置,更换mysql驱动
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.XCode" Version="9.7.6722.39741" />
|
||||
<PackageReference Include="NewLife.XCode" Version="9.8.6755.22252" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -5,23 +5,21 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0" />
|
||||
<PackageReference Include="MySqlConnector" Version="0.42.0" />
|
||||
<PackageReference Include="NewLife.XCode" Version="9.7.6722.39741" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
|
||||
<PackageReference Include="MySql.Data" Version="8.0.11" />
|
||||
<PackageReference Include="NewLife.XCode" Version="9.8.6755.22252" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="14.14.0" />
|
||||
<PackageReference Include="Senparc.Weixin.WxOpen" Version="1.10.5" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.5.0" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="15.0.6.1" />
|
||||
<PackageReference Include="Senparc.Weixin.WxOpen" Version="2.0.6.1" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" />
|
||||
<PackageReference Include="ZKWeb.System.Drawing" Version="4.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\COMCMS.Common\COMCMS.Common.csproj" />
|
||||
<ProjectReference Include="..\COMCMS.Core\COMCMS.Core.csproj" />
|
||||
<ProjectReference Include="..\Lib.Core\Lib.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace COMCMS.Web.Common
|
||||
{
|
||||
context.HttpContext.Request.ContentType = "application/json";
|
||||
context.HttpContext.Request.Headers["Accept"] = "application/json";
|
||||
ReJSON model = new ReJSON(5001, "执行错误:" + context.Exception.Message);
|
||||
ReJson model = new ReJson(5001, "执行错误:" + context.Exception.Message);
|
||||
context.Result = new JsonResult(model);
|
||||
base.OnException(context);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace COMCMS.Web.ExceptionHandler
|
||||
{
|
||||
string message = exception.Message;
|
||||
|
||||
ReJSON error = new ReJSON(message);
|
||||
|
||||
ReJson error = new ReJson(message);
|
||||
context.Response.ContentType = "text/json";
|
||||
await context.Response.WriteAsync(error.ToJson());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ using COMCMS.Web.Controllers.api;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
|
||||
|
||||
|
||||
namespace COMCMS.Web.Filter
|
||||
{
|
||||
public class CheckFilterAttribute : ActionFilterAttribute
|
||||
@@ -41,7 +43,7 @@ namespace COMCMS.Web.Filter
|
||||
}
|
||||
}
|
||||
|
||||
private ReJSON ValiSignature(HttpContext context)
|
||||
private ReJson ValiSignature(HttpContext context)
|
||||
{
|
||||
var Request = context.Request;
|
||||
|
||||
@@ -77,7 +79,7 @@ namespace COMCMS.Web.Filter
|
||||
if (!MySign.CheckSign(pars, signature))
|
||||
{
|
||||
|
||||
return new ReJSON(40004, "signature 错误!");
|
||||
return new ReJson(40004, "signature 错误!");
|
||||
}
|
||||
//判断是否超时
|
||||
string timeStamp = pars["timeStamp"];
|
||||
@@ -85,7 +87,7 @@ namespace COMCMS.Web.Filter
|
||||
DateTime postTime = Utils.StampToDateTime(timeStamp);
|
||||
if (postTime < DateTime.Now.AddSeconds(-120))//30秒有效期
|
||||
{
|
||||
return new ReJSON(40004, "signature 错误!", 1);
|
||||
return new ReJson(40004, "signature 错误!", 1);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+41
-2
@@ -17,6 +17,13 @@ using COMCMS.Web.Models;
|
||||
using COMCMS.Web.Common;
|
||||
using COMCMS.Web.ExceptionHandler;
|
||||
using Lib.Core.MiddlewareExtension.Extension;
|
||||
using Senparc.Weixin.Entities;
|
||||
using Senparc.CO2NET;
|
||||
using Senparc.CO2NET.RegisterServices;
|
||||
using Senparc.Weixin;
|
||||
using Senparc.CO2NET.Cache;
|
||||
using System.Configuration;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace COMCMS.Web
|
||||
{
|
||||
@@ -70,7 +77,7 @@ namespace COMCMS.Web
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider svp)
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider svp, IOptions<SenparcSetting> senparcSetting, IOptions<SenparcWeixinSetting> senparcWeixinSetting)
|
||||
{
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
@@ -121,9 +128,41 @@ namespace COMCMS.Web
|
||||
});
|
||||
|
||||
app.UseMiddlewareExtension(new ResultExceptionHandler());
|
||||
|
||||
RegisterService.Start(env, senparcSetting.Value)
|
||||
.UseSenparcWeixin(senparcWeixinSetting.Value, false/*此处为单独用于微信的调试状态*/, () => GetExContainerCacheStrategies());
|
||||
//加入HttpContext
|
||||
//MyHttpContext.ServiceProvider = svp;
|
||||
}
|
||||
|
||||
#region Senparc 缓存扩展策略
|
||||
/// <summary>
|
||||
/// 获取Container扩展缓存策略
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private IList<IDomainExtensionCacheStrategy> GetExContainerCacheStrategies()
|
||||
{
|
||||
var exContainerCacheStrategies = new List<IDomainExtensionCacheStrategy>();
|
||||
|
||||
//如果有配置,可以去掉下面注释
|
||||
|
||||
////判断Redis是否可用
|
||||
//var redisConfiguration = ConfigurationManager.AppSettings["Cache_Redis_Configuration"];
|
||||
//if ((!string.IsNullOrEmpty(redisConfiguration) && redisConfiguration != "Redis配置"))
|
||||
//{
|
||||
// exContainerCacheStrategies.Add(RedisContainerCacheStrategy.Instance);
|
||||
//}
|
||||
|
||||
////判断Memcached是否可用
|
||||
//var memcachedConfiguration = ConfigurationManager.AppSettings["Cache_Memcached_Configuration"];
|
||||
//if ((!string.IsNullOrEmpty(memcachedConfiguration) && memcachedConfiguration != "Memcached配置"))
|
||||
//{
|
||||
// exContainerCacheStrategies.Add(MemcachedContainerCacheStrategy.Instance);
|
||||
//}
|
||||
|
||||
//也可扩展自定义的缓存策略
|
||||
|
||||
return exContainerCacheStrategies;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<add key="SignSalt" value="mycomcms" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<!--<add name="dbconn" connectionString="Server=.;Port=3306;Database=comcmscore;Uid=root;Pwd=root;" providerName="MySql.Data.MySqlClient" />-->
|
||||
<!--<add name="dbconn" connectionString="Server=.;Port=3306;Database=comcmscore;Uid=root;Pwd=root;SslMode=None" providerName="MySql.Data.MySqlClient" />-->
|
||||
<!--<add name="dbconn" connectionString="server=(local);database=comcmscore;uid=sa;pwd=123456" providerName="System.Data.SqlClient" />-->
|
||||
<!--<add name="dbconn" connectionString="Data Source=~/App_Data/ratuodb.db" providerName="Sqlite" />-->
|
||||
</connectionStrings>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"connectionStrings": {
|
||||
"dbconn": {
|
||||
"connectionString": "Server=.;Port=3306;Database=comcms2;Uid=root;Pwd=root;",
|
||||
"connectionString": "Server=.;Port=3306;Database=comcms2;Uid=root;Pwd=root;SslMode=None",
|
||||
"providerName": "MySql.Data.MySqlClient"
|
||||
},
|
||||
"mssqlconnon": {
|
||||
|
||||
+7
-1
@@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COMCMS.Common", "COMCMS.Com
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XCoder(代码生成器)", "XCoder\XCoder(代码生成器).csproj", "{71539325-194B-4D56-8D88-562B33004406}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "COMCMS.API", "COMCMS.API\COMCMS.API.csproj", "{ED1581D0-7E94-4ADC-B2B4-0A523EA3B512}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COMCMS.API", "COMCMS.API\COMCMS.API.csproj", "{ED1581D0-7E94-4ADC-B2B4-0A523EA3B512}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib.Core", "Lib.Core\Lib.Core.csproj", "{1957CA2B-3008-46A3-8EE4-38B2F06466A8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -39,6 +41,10 @@ Global
|
||||
{ED1581D0-7E94-4ADC-B2B4-0A523EA3B512}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ED1581D0-7E94-4ADC-B2B4-0A523EA3B512}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ED1581D0-7E94-4ADC-B2B4-0A523EA3B512}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1957CA2B-3008-46A3-8EE4-38B2F06466A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1957CA2B-3008-46A3-8EE4-38B2F06466A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1957CA2B-3008-46A3-8EE4-38B2F06466A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1957CA2B-3008-46A3-8EE4-38B2F06466A8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user