diff --git a/COMCMS.Web/COMCMS.Web.csproj b/COMCMS.Web/COMCMS.Web.csproj
index 520d150..7bff4a3 100644
--- a/COMCMS.Web/COMCMS.Web.csproj
+++ b/COMCMS.Web/COMCMS.Web.csproj
@@ -14,6 +14,7 @@
+
diff --git a/COMCMS.Web/Controllers/HomeController.cs b/COMCMS.Web/Controllers/HomeController.cs
index 60afa14..5962474 100644
--- a/COMCMS.Web/Controllers/HomeController.cs
+++ b/COMCMS.Web/Controllers/HomeController.cs
@@ -18,16 +18,19 @@ using Newtonsoft.Json;
using COMCMS.Web.Common;
using Microsoft.AspNetCore.Hosting;
using System.Text.RegularExpressions;
+using NewLife.Caching;
namespace COMCMS.Web.Controllers
{
public class HomeController : HomeBaseController
{
private IWebHostEnvironment _env;
+ private readonly ICacheProvider _cacheProvider;
- public HomeController(IWebHostEnvironment env)
+ public HomeController(IWebHostEnvironment env,ICacheProvider cacheProvider)
{
_env = env;
+ _cacheProvider = cacheProvider;
}
#region 首页
@@ -455,6 +458,7 @@ namespace COMCMS.Web.Controllers
return View();
}
#endregion
+
#region 测试
public IActionResult Test()
{
@@ -473,7 +477,13 @@ namespace COMCMS.Web.Controllers
string result = $"t1:{t1}; t2:{t2}; t3:{t3}; t4:{t4}; t5:{t5}; t6:{t6}";
- return Content(result);
+
+
+ _cacheProvider.Cache.Add("test", "test", 60);
+
+ string a = _cacheProvider.Cache.Get("test");
+
+ return Content(result+";cache:"+ a);
}
#endregion
}
diff --git a/COMCMS.Web/Startup.cs b/COMCMS.Web/Startup.cs
index 105c11c..edbfd09 100644
--- a/COMCMS.Web/Startup.cs
+++ b/COMCMS.Web/Startup.cs
@@ -23,6 +23,8 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.WebEncoders;
using Microsoft.IdentityModel.Tokens;
+using NewLife.Caching;
+using NewLife.Caching.Services;
using Newtonsoft.Json.Serialization;
using Senparc.CO2NET;
using Senparc.CO2NET.Cache;
@@ -65,6 +67,7 @@ namespace COMCMS.Web
options.Cookie.HttpOnly = true;
});
+ services.AddSingleton();
//部分系统配置
services.Configure(Configuration.GetSection("SystemSetting"));
diff --git a/COMCMS.Web/appsettings.json b/COMCMS.Web/appsettings.json
index cd516bc..31acf14 100644
--- a/COMCMS.Web/appsettings.json
+++ b/COMCMS.Web/appsettings.json
@@ -5,6 +5,7 @@
"Default": "Warning"
}
},
+ "RedisCache": "server=127.0.0.1;password=;db=2",
"SystemSetting": {
"FileAllowedExtensions": "zip,rar,7z,doc,docx,xls,xlsx,ppt,pptx,csv,pdf,txt,gz,gzip,gif,png,jpg,jpeg,bmp,avi,fla,flv,swf,mp4,mp3,mov,mid,mpg,mpeg,rm,rmvb,wma,wav,wmv",
"ImageAllowedExtensions": "gif,png,jpg,jpeg,bmp",
diff --git a/COMCMS.Web/wwwroot/editor/ckeditor/config.js b/COMCMS.Web/wwwroot/editor/ckeditor/config.js
index 8935f40..5c884dd 100644
--- a/COMCMS.Web/wwwroot/editor/ckeditor/config.js
+++ b/COMCMS.Web/wwwroot/editor/ckeditor/config.js
@@ -6,7 +6,8 @@
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
//config.language = 'zh-cn';
- // config.uiColor = '#AADC6E';
+ // config.uiColor = '#AADC6E';
+ config.versionCheck = false;
config.baseHref = "http://" + location.host;
config.filebrowserImageUploadUrl = '/AdminCP/Upload/CKUploadImage?action=uploadimg';
config.filebrowserUploadUrl = '/AdminCP/Upload/CKUploadFile?action=uploadfile';