Browse Source

去掉cache缓存

liyuanyuan 4 years ago
parent
commit
01d1c44f5d

+ 0 - 90
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -328,7 +328,6 @@
328 328
     <Compile Include="Startup.cs" />
329 329
   </ItemGroup>
330 330
   <ItemGroup>
331
-    <Content Include="Views\web.config" />
332 331
     <Content Include="packages.config">
333 332
       <SubType>Designer</SubType>
334 333
     </Content>
@@ -364,95 +363,6 @@
364 363
   </ItemGroup>
365 364
   <ItemGroup>
366 365
     <Folder Include="App_Data\" />
367
-    <Folder Include="Views\AutoCallOut\" />
368
-    <Folder Include="Views\Base\" />
369
-    <Folder Include="Views\Business\" />
370
-    <Folder Include="Views\Callblack\" />
371
-    <Folder Include="Views\CallIn\" />
372
-    <Folder Include="Views\Callleave\" />
373
-    <Folder Include="Views\CallOutOpt\" />
374
-    <Folder Include="Views\CallOutScreen\" />
375
-    <Folder Include="Views\CallOut\" />
376
-    <Folder Include="Views\CallPlan\" />
377
-    <Folder Include="Views\Callrecords\" />
378
-    <Folder Include="Views\CeShi\" />
379
-    <Folder Include="Views\CustomerNew\" />
380
-    <Folder Include="Views\Customer\" />
381
-    <Folder Include="Views\DaysTalkTime\" />
382
-    <Folder Include="Views\Default\" />
383
-    <Folder Include="Views\Department\" />
384
-    <Folder Include="Views\Dictionary\" />
385
-    <Folder Include="Views\DutyPhone\" />
386
-    <Folder Include="Views\DXRecords\" />
387
-    <Folder Include="Views\DXReports\" />
388
-    <Folder Include="Views\DXTel\" />
389
-    <Folder Include="Views\FilterOrder\" />
390
-    <Folder Include="Views\FollowUp\" />
391
-    <Folder Include="Views\Get\" />
392
-    <Folder Include="Views\hfOpt\" />
393
-    <Folder Include="Views\Home\" />
394
-    <Folder Include="Views\HourCallTotal\" />
395
-    <Folder Include="Views\IndexBase\" />
396
-    <Folder Include="Views\IndexCategory\" />
397
-    <Folder Include="Views\Index\" />
398
-    <Folder Include="Views\Info\" />
399
-    <Folder Include="Views\InputDXTel\" />
400
-    <Folder Include="Views\IVRWords\" />
401
-    <Folder Include="Views\KnowledgeClass\" />
402
-    <Folder Include="Views\Knowledge\" />
403
-    <Folder Include="Views\LeaveMessag\" />
404
-    <Folder Include="Views\Login\" />
405
-    <Folder Include="Views\Log\" />
406
-    <Folder Include="Views\Message\" />
407
-    <Folder Include="Views\Mobiledata\" />
408
-    <Folder Include="Views\Module\" />
409
-    <Folder Include="Views\Msg\" />
410
-    <Folder Include="Views\News\" />
411
-    <Folder Include="Views\Notice\" />
412
-    <Folder Include="Views\Order\" />
413
-    <Folder Include="Views\Product\" />
414
-    <Folder Include="Views\QCManage\" />
415
-    <Folder Include="Views\QCResult\" />
416
-    <Folder Include="Views\QuestionAnswer\" />
417
-    <Folder Include="Views\Questionnaire\" />
418
-    <Folder Include="Views\RegionCategory\" />
419
-    <Folder Include="Views\RoleF\" />
420
-    <Folder Include="Views\RoleInfo\" />
421
-    <Folder Include="Views\SeatGroup\" />
422
-    <Folder Include="Views\SeatMonitoring\" />
423
-    <Folder Include="Views\SMSZXZB\" />
424
-    <Folder Include="Views\SMS\" />
425
-    <Folder Include="Views\SwitchedlossCall\" />
426
-    <Folder Include="Views\SysConfig\" />
427
-    <Folder Include="Views\TalkTime\" />
428
-    <Folder Include="Views\TotalCall\" />
429
-    <Folder Include="Views\UserAccount\" />
430
-    <Folder Include="Views\Validate\" />
431
-    <Folder Include="Views\VisFile\" />
432
-    <Folder Include="Views\visitfpset\" />
433
-    <Folder Include="Views\VisithfOpt\" />
434
-    <Folder Include="Views\VisitInput\" />
435
-    <Folder Include="Views\VisitRecords\" />
436
-    <Folder Include="Views\VisitReport\" />
437
-    <Folder Include="Views\VisitTelphone\" />
438
-    <Folder Include="Views\WoBill\" />
439
-    <Folder Include="Views\WOReport\" />
440
-    <Folder Include="Views\Workcalendar\" />
441
-    <Folder Include="Views\WorkOffDays\" />
442
-    <Folder Include="Views\WorkOrderLogs\" />
443
-    <Folder Include="Views\WorkOrderNew\" />
444
-    <Folder Include="Views\WorkOrdersComplaintType\" />
445
-    <Folder Include="Views\WorkOrdersHandledRate\" />
446
-    <Folder Include="Views\WorkOrdersType\" />
447
-    <Folder Include="Views\WorkOrdersVisiSatisfactiont\" />
448
-    <Folder Include="Views\WorkOrders\" />
449
-    <Folder Include="Views\WorkOrder\" />
450
-    <Folder Include="Views\WxCustom\" />
451
-    <Folder Include="Views\WxReceive\" />
452
-    <Folder Include="Views\WxReport\" />
453
-    <Folder Include="Views\YearContrast\" />
454
-    <Folder Include="Views\ZuoXiTongHua\" />
455
-    <Folder Include="Views\ZuoXiWorkTotal\" />
456 366
   </ItemGroup>
457 367
   <ItemGroup>
458 368
     <ProjectReference Include="..\..\..\CallCenterCommon\CallCenter.Utility\CallCenter.Utility.csproj">

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Login/LoginController.cs

@@ -73,7 +73,7 @@ namespace CallCenterApi.Interface.Controllers
73 73
                     var token = FormsPrincipal<Cache.Models.CurrentUserInfo>.GetCookieValue(currentUserInfo.F_UserCode, currentUserInfo);
74 74
 
75 75
                     //放入缓存
76
-                    CacheHelper.Insert(token, currentUserInfo, 1440);
76
+                   // CacheHelper.Insert(token, currentUserInfo, 1440);
77 77
                     return Success("登录成功", new
78 78
                     {
79 79
                         token = token

+ 7 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Global.asax.cs

@@ -1,4 +1,5 @@
1
-using CallCenterApi.Common;
1
+using CallCenter.Utility;
2
+using CallCenterApi.Common;
2 3
 using CallCenterApi.Interface.Models.Common;
3 4
 using System;
4 5
 using System.Collections.Generic;
@@ -32,13 +33,14 @@ namespace CallCenterApi.Interface
32 33
             try
33 34
             {
34 35
                 //获取缓存
35
-                var dict = CacheHelper.Get(token);
36
-                if (dict == null) return;
36
+                //var dict = CacheHelper.Get(token);
37
+                //if (dict == null) return;
37 38
                 Cache.Models.CurrentUserInfo userData = null;
38 39
                 //获取FormsAuthenticationTicket对象
39 40
                 FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(token);
40
-                if (ticket != null && string.IsNullOrEmpty(ticket.UserData) == false)
41
-                    userData = (new JavaScriptSerializer()).Deserialize<Cache.Models.CurrentUserInfo>(ticket.UserData); //还原用户数据
41
+                if (ticket != null && !ticket.Expired && string.IsNullOrEmpty(ticket.UserData) == false)      
42
+                userData = (new JavaScriptSerializer()).Deserialize<Cache.Models.CurrentUserInfo>(ticket.UserData); //还原用户数据
43
+              
42 44
                 if (ticket != null && userData != null)
43 45
                     context.User = new FormsPrincipal<Cache.Models.CurrentUserInfo> (ticket, userData);//重新给context.User赋值。
44 46
             }

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/FormsPrincipal.cs

@@ -67,7 +67,7 @@ namespace CallCenterApi.Interface.Models.Common
67 67
 
68 68
             // 2. 创建一个FormsAuthenticationTicket,它包含登录名以及额外的用户数据。
69 69
             FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
70
-                2, loginName, DateTime.Now, DateTime.Now.AddDays(1), true, data);
70
+                2, loginName, DateTime.Now, DateTime.Now.AddDays(7), true, data);
71 71
 
72 72
 
73 73
             // 3. 加密Ticket,变成一个加密的字符串。

+ 0 - 42
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Views/web.config

@@ -1,42 +0,0 @@
1
-<?xml version="1.0"?>
2
-
3
-<configuration>
4
-  <configSections>
5
-    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
6
-      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
7
-      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
8
-    </sectionGroup>
9
-  </configSections>
10
-
11
-  <system.web.webPages.razor>
12
-    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
13
-    <pages pageBaseType="System.Web.Mvc.WebViewPage">
14
-      <namespaces>
15
-        <add namespace="System.Web.Mvc" />
16
-        <add namespace="System.Web.Mvc.Ajax" />
17
-        <add namespace="System.Web.Mvc.Html" />
18
-        <add namespace="System.Web.Routing" />
19
-        <add namespace="CallCenterApi.Interface" />
20
-      </namespaces>
21
-    </pages>
22
-  </system.web.webPages.razor>
23
-
24
-  <appSettings>
25
-    <add key="webpages:Enabled" value="false" />
26
-  </appSettings>
27
-
28
-  <system.webServer>
29
-    <handlers>
30
-      <remove name="BlockViewHandler"/>
31
-      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
32
-    </handlers>
33
-  </system.webServer>
34
-
35
-  <system.web>
36
-    <compilation>
37
-      <assemblies>
38
-        <add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
39
-      </assemblies>
40
-    </compilation>
41
-  </system.web>
42
-</configuration>