mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 16:23:26 +08:00
【新增】新增【EasyCaching.CSRedis】redis组件,替换SqlSugar二级缓存的【StackExchange.Redis】组件实现,使用异步替代同步处理二级缓存,解决【StackExchange.Redis】超过200并发后的异常情况。异步提升二级缓存获取效率。
【新增】appsetting.json配置文件增加【AppPcUrl】PC端访问地址,【AppH5Url】H5端访问地址,方便对接pc端、h5端、微信公众号端。
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofac" Version="6.4.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NPOI" Version="2.5.6" />
|
||||
<PackageReference Include="ToolGood.Words" Version="3.0.3.1" />
|
||||
|
||||
55
CoreCms.Net.Utility/Storage.cs
Normal file
55
CoreCms.Net.Utility/Storage.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Autofac;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace CoreCms.Net.Utility
|
||||
{
|
||||
|
||||
public static class Storage
|
||||
{
|
||||
/// <summary>
|
||||
/// 静态构造函数
|
||||
/// </summary>
|
||||
static Storage()
|
||||
{
|
||||
//var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory())
|
||||
// .AddJsonFile("appsettings.json", true, true);
|
||||
//Configuration = builder.Build();
|
||||
|
||||
//Assemblys = DependencyContext.Default.CompileLibraries
|
||||
// .Where(x => x.Type == "project")
|
||||
// .Select(x => AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(x.Name)))
|
||||
// .ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 配置文件的根节点
|
||||
/// </summary>
|
||||
public static IConfigurationRoot Configuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 全局程序集
|
||||
/// </summary>
|
||||
//public static List<Assembly> Assemblys { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Autofac依赖注入静态服务
|
||||
/// </summary>
|
||||
public static ILifetimeScope Container;
|
||||
|
||||
/// <summary>
|
||||
/// 获取服务(Single)
|
||||
/// </summary>
|
||||
/// <typeparam name="T">接口类型</typeparam>
|
||||
/// <returns></returns>
|
||||
public static T GetService<T>() where T : class
|
||||
{
|
||||
return Container.Resolve<T>();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user