From 78389519e546d5b366cea83f67df4016a3f6a290 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期二, 10 十一月 2026 21:28:29 +0800
Subject: [PATCH] 网关添加 跨域配置

---
 appsettings.json |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/appsettings.json b/appsettings.json
index 6e9de47..e75c39a 100644
--- a/appsettings.json
+++ b/appsettings.json
@@ -6,15 +6,27 @@
     }
   },
   "AllowedHosts": "*",
+  "Gateway": {
+    "FileFilter": {
+      "Enabled": true,
+      "BlockedExtensions": [ ".dll", ".log" ]
+    },
+    "ErrorPage": {
+      "Enabled": true,
+      "LogPageEnabled": true,
+      "LogPageDirectory": "PageLogs"
+    }
+  },
   "ReverseProxy": {
     "Routes": {
       "mes-backend": {
         "ClusterId": "mes-backend",
+        "CorsPolicy": "frontend-dev",
         "Match": {
-          "Path": "/API_NW/{**catch-all}"
+          "Path": "/API/{**catch-all}"
         },
         "Transforms": [
-          { "PathRemovePrefix": "/API_NW" }
+          //{ "PathRemovePrefix": "/API" }
         ]
       }
     },
@@ -22,10 +34,13 @@
       "mes-backend": {
         "Destinations": {
           "backend": {
-            "Address": "http://localhost:8090"
+            "Address": "http://localhost:81"
           }
         }
       }
     }
+    // 娉ㄦ剰锛歒ARP 娌℃湁 "CorsPolicies" 杩欎釜閰嶇疆鑺傦紙鍐欎簡涔熶細琚潤榛樺拷鐣ワ級銆�
+    // 璺敱涓婄殑 "CorsPolicy" 鍙槸绛栫暐鍚嶏紝鐪熸鐨勭瓥鐣ュ畾涔夊湪 Program.cs 鐨� AddCors(...) 閲岋紝
+    // 涓ゅ鍚嶅瓧蹇呴』瀹屽叏涓�鑷淬��
   }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1