Przeglądaj źródła

Merge branch 'master' of http://192.168.1.222:3000/duhongyu/Anyang_api

duhongyu 4 lat temu
rodzic
commit
f030cbd81c

+ 38 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/App_Start/OutOutActionFilter.cs

@@ -0,0 +1,38 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Common;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Linq;
6
+using System.Web;
7
+using System.Web.Mvc;
8
+
9
+namespace CallCenterApi.Interface.App_Start
10
+{
11
+    public class OutOutActionFilter : ActionFilterAttribute
12
+    {
13
+        public override void OnActionExecuting(ActionExecutingContext filterContext)
14
+        {
15
+            var sign = filterContext.HttpContext.Request["signcode"];
16
+            bool bl = true;
17
+            if (sign != null)
18
+            {
19
+                string insigncode = sign.ToString();
20
+                string outsigncode = Configs.GetValue("OutSignCode");
21
+                string controllercode = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName.ToLower();
22
+                string actioncode = filterContext.ActionDescriptor.ActionName.ToLower();
23
+                string signcode = EncryptHelper.MD5Encrypt(controllercode + "/" + actioncode + "+" + EncryptHelper.SHA1Encrypt(outsigncode + "+" + DateTime.Now.ToString("yyyyMMdd")));
24
+                if (insigncode == signcode)
25
+                {
26
+                    bl = false;
27
+                }
28
+            }
29
+            if (bl)
30
+            {
31
+                filterContext.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.error.ToString(), message = "签名错误" }.ToJson() };
32
+                return;
33
+            }
34
+
35
+            base.OnActionExecuting(filterContext);
36
+        }
37
+    }
38
+}

+ 3 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -167,6 +167,7 @@
167 167
     <Compile Include="App_Start\AuthorizeAttribute.cs" />
168 168
     <Compile Include="App_Start\FilterConfig.cs" />
169 169
     <Compile Include="App_Start\ErrorAttribute.cs" />
170
+    <Compile Include="App_Start\OutOutActionFilter.cs" />
170 171
     <Compile Include="App_Start\OutActionFilter.cs" />
171 172
     <Compile Include="App_Start\RouteConfig.cs" />
172 173
     <Compile Include="App_Start\WechatActionFilter.cs" />
@@ -208,6 +209,7 @@
208 209
     <Compile Include="Controllers\Login\AES256Controller.cs" />
209 210
     <Compile Include="Controllers\Login\LoginController.cs" />
210 211
     <Compile Include="Controllers\FunctionController.cs" />
212
+    <Compile Include="Controllers\Out\OutApiController.cs" />
211 213
     <Compile Include="Controllers\report\BusinessController.cs" />
212 214
     <Compile Include="Controllers\report\CallInController.cs" />
213 215
     <Compile Include="Controllers\report\DataAnalysisController.cs" />
@@ -371,6 +373,7 @@
371 373
     <Folder Include="Views\Module\" />
372 374
     <Folder Include="Views\NoticeCriticism\" />
373 375
     <Folder Include="Views\Notice\" />
376
+    <Folder Include="Views\OutApi\" />
374 377
     <Folder Include="Views\RecordSet\" />
375 378
     <Folder Include="Views\Repository\" />
376 379
     <Folder Include="Views\RoleF\" />

+ 1 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Configs/system.config

@@ -88,4 +88,5 @@
88 88
   <add key="indextime" value="30000*60" />
89 89
   <add key="messageTime" value="60000" />
90 90
   <add key="AuthDate" value="2021-10-12" />
91
+  <add key="OutSignCode" value="$AY12345#" />
91 92
 </appSettings>

+ 18 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Out/OutApiController.cs

@@ -0,0 +1,18 @@
1
+using CallCenterApi.Interface.Controllers.Base;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Web;
6
+using System.Web.Mvc;
7
+
8
+namespace CallCenterApi.Interface.Controllers.Out
9
+{
10
+    public class OutApiController : BaseController
11
+    {
12
+        // GET: OutApi
13
+        public ActionResult Index()
14
+        {
15
+            return View();
16
+        }
17
+    }
18
+}