From 7537462fc4d3be050dacc747d97d7bdef64e651e Mon Sep 17 00:00:00 2001 From: liujiaqiang <1448951783@qq.com> Date: Fri, 30 Jun 2023 14:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=A8=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/Model/CustomCorsActionFilterAttribute.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/24Hour/Model/CustomCorsActionFilterAttribute.cs b/24Hour/Model/CustomCorsActionFilterAttribute.cs index 8414ea5..16e18a1 100644 --- a/24Hour/Model/CustomCorsActionFilterAttribute.cs +++ b/24Hour/Model/CustomCorsActionFilterAttribute.cs @@ -7,6 +7,8 @@ namespace _24Hour.Model public void OnActionExecuting(ActionExecutingContext context) { + context.HttpContext.Response.Headers.Add("Access-Control-Allow-Methods", "OPTIONS,POST,GET"); + context.HttpContext.Response.Headers.Add("Access-Control-Allow-Headers", "x-requested-with"); context.HttpContext.Response.Headers.Add("Access-Control-Allow-Origin", "*"); }