From b4dba39ce6afc201ede288ada4295a5fa345092f Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 27 四月 2026 12:13:51 +0800
Subject: [PATCH] 抽样方案基础资料
---
WebAPI/App_Start/WebApiConfig.cs | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/WebAPI/App_Start/WebApiConfig.cs b/WebAPI/App_Start/WebApiConfig.cs
index 059fbdc..d5bfd3c 100644
--- a/WebAPI/App_Start/WebApiConfig.cs
+++ b/WebAPI/App_Start/WebApiConfig.cs
@@ -1,8 +1,11 @@
-锘縰sing System;
+锘縰sing project.Filter;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
-
+using System.Web.Http.Cors;
+using WebAPI.Dapper;
+using WebAPI.Service;
namespace WebAPI
{
public static class WebApiConfig
@@ -13,7 +16,9 @@
GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
// Web API 璺敱
config.MapHttpAttributeRoutes();
-
+ new SqlPools();
+ var corsAttr = new EnableCorsAttribute("*", "*", "*");
+ config.EnableCors(corsAttr);
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
@@ -25,6 +30,13 @@
routeTemplate: "actionapi/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
+ //娉ㄥ唽绛惧悕
+ config.Filters.Add(new SignatureVerifyAttribute());
+ //// 鍏ㄥ眬鍚敤 JWT 璁よ瘉
+ //config.Filters.Add(new JwtAuthorizeAttribute());
+
+ //// 鍚敤JWT鍝嶅簲鎷︽埅鍣紝鑷姩鍒锋柊JWT
+ //config.MessageHandlers.Add(new TokenAppendHandler());
}
}
}
--
Gitblit v1.9.1