From edaea6fcccd831348cda88409f4125d067a0264e Mon Sep 17 00:00:00 2001 From: falcon <9504402@qq.com> Date: Thu, 28 Mar 2019 09:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AAresid=20Cac?= =?UTF-8?q?he=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs | 4 +++- WebSiteCode/Cmdjy/Cmdjy/Web.config | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs b/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs index 608bd41..0ea91cb 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs +++ b/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs @@ -90,10 +90,12 @@ namespace Cmdjy.Bll } private static string toJson(object value) { + if(value == null) return null; return JsonConvert.SerializeObject(value); } - private static T fromJson(string value) { + private static T fromJson(string value) where T : class { + if(value == null) return null; return JsonConvert.DeserializeObject(value); } } diff --git a/WebSiteCode/Cmdjy/Cmdjy/Web.config b/WebSiteCode/Cmdjy/Cmdjy/Web.config index 7124276..b071647 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Web.config +++ b/WebSiteCode/Cmdjy/Cmdjy/Web.config @@ -17,7 +17,7 @@ - +