From edb0c01ec0eae49cd954a30c933f6c1eacfcc4a5 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Tue, 5 May 2026 15:52:11 +0800 Subject: [PATCH] =?UTF-8?q?cors=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 8a8856a..716c063 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -11,6 +11,22 @@ spring: name: aida-gateway cloud: gateway: + # ---------- 全局 CORS 配置 ---------- + globalcors: + cors-configurations: + '[/**]': + allowed-origin-patterns: "*" + allowed-methods: + - GET + - POST + - PUT + - DELETE + - OPTIONS + - PATCH + allowed-headers: "*" + allow-credentials: true + max-age: 3600 + # ---------- 路由配置 ---------- routes: - id: aida-back uri: lb://aida-back