From fd607ee07d2504cddfd4df111ea5a44fa0e1a7bc Mon Sep 17 00:00:00 2001 From: wulin Date: Sun, 30 Mar 2025 18:07:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=83=A8=E5=88=86=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-online.yml | 18 +++- api-gateway/src/main/resources/bootstrap.yml | 3 +- .../main/resources/{ => log}/logback-dev.xml | 0 .../logback-online.xml} | 2 +- .../src/main/resources/logback-test.xml | 84 ------------------- 5 files changed, 20 insertions(+), 87 deletions(-) rename api-gateway/src/main/resources/{ => log}/logback-dev.xml (100%) rename api-gateway/src/main/resources/{logback-prod.xml => log/logback-online.xml} (97%) delete mode 100644 api-gateway/src/main/resources/logback-test.xml diff --git a/api-gateway/src/main/resources/bootstrap-online.yml b/api-gateway/src/main/resources/bootstrap-online.yml index e774819..a3e7995 100644 --- a/api-gateway/src/main/resources/bootstrap-online.yml +++ b/api-gateway/src/main/resources/bootstrap-online.yml @@ -45,4 +45,20 @@ spring: # 允许跨域的method, 默认为GET和OPTIONS,设置*为全部 allowedMethods: "*" # 允许跨域请求里的head字段,设置*为全部 - allowedHeaders: "*" \ No newline at end of file + allowedHeaders: "*" +# 安全配置 +security: + # 防止XSS攻击 + xss: + enabled: false + # 排除的路径 + exclude-urls: + - /api-interface/user/login/pwd + # ip免登白名单 + auth-ip: #127.0.0.1,192.168.8.141 + #免登,免校验url + auth-urls: +#application: +# cors: +# allowed-crigin-patterns: +# - /api-user/user/user/login/pwd \ No newline at end of file diff --git a/api-gateway/src/main/resources/bootstrap.yml b/api-gateway/src/main/resources/bootstrap.yml index abed308..1f9dee8 100644 --- a/api-gateway/src/main/resources/bootstrap.yml +++ b/api-gateway/src/main/resources/bootstrap.yml @@ -10,7 +10,8 @@ spring: allow-circular-references: true - +logging: + config: classpath:log/logback-${spring.profiles.active}.xml zuul: ribbon: eager-load: diff --git a/api-gateway/src/main/resources/logback-dev.xml b/api-gateway/src/main/resources/log/logback-dev.xml similarity index 100% rename from api-gateway/src/main/resources/logback-dev.xml rename to api-gateway/src/main/resources/log/logback-dev.xml diff --git a/api-gateway/src/main/resources/logback-prod.xml b/api-gateway/src/main/resources/log/logback-online.xml similarity index 97% rename from api-gateway/src/main/resources/logback-prod.xml rename to api-gateway/src/main/resources/log/logback-online.xml index 6f6fde7..c3989d4 100644 --- a/api-gateway/src/main/resources/logback-prod.xml +++ b/api-gateway/src/main/resources/log/logback-online.xml @@ -1,7 +1,7 @@ - + diff --git a/api-gateway/src/main/resources/logback-test.xml b/api-gateway/src/main/resources/logback-test.xml deleted file mode 100644 index 09ffc80..0000000 --- a/api-gateway/src/main/resources/logback-test.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - ${log.pattern} - UTF-8 - - - - - - ${log.path}/all.log - - - - ${log.path}/%d{yyyy-MM-dd}_all.log - - 15 - - - ${log.pattern} - UTF-8 - - - - INFO - - - - - - - ${log.path}/warn.log - - - - ${log.path}/%d{yyyy-MM-dd}_wran.log - - 15 - - - ${log.pattern} - UTF-8 - - - - WARN - - - - - ${log.path}/error.log - - - - ${log.path}/%d{yyyy-MM-dd}_error.log - - 15 - - - ${log.pattern} - UTF-8 - - - - ERROR - - - - - - - - - - - - \ No newline at end of file