From 0d2a5fc482ba7ffaaefa6276e2475727e7160753 Mon Sep 17 00:00:00 2001
From: zhizhijie <zhizhijie@users.noreply.gitee.com>
Date: 星期三, 16 九月 2026 11:31:35 +0800
Subject: [PATCH] fix(cors): 放行内网网段来源,修复局域网 IP 访问时登录 403
---
traffic-audit-server/src/main/resources/application.yml.example | 47 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/traffic-audit-server/src/main/resources/application.yml.example b/traffic-audit-server/src/main/resources/application.yml.example
index e1785be..dc87cf7 100644
--- a/traffic-audit-server/src/main/resources/application.yml.example
+++ b/traffic-audit-server/src/main/resources/application.yml.example
@@ -1,13 +1,27 @@
# 澶嶅埗涓� application.yml 骞舵浛鎹㈠崰浣嶇鍚庝娇鐢紙鐪熷疄瀵嗛挜涓嶅叆搴擄級
server:
port: 8090
+ tomcat:
+ basedir: .
+ threads:
+ max: 500
+ accesslog:
+ enabled: true
+ directory: logs
+ prefix: access
+ suffix: .log
+ pattern: '%h %l %u %t "%r" %s %b %D'
spring:
datasource:
- url: jdbc:mysql://localhost:3305/traffic_audit?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false
+ url: jdbc:mysql://localhost:3305/traffic_audit?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true
username: root
password: ${MYSQL_PASSWORD:root}
driver-class-name: com.mysql.cj.jdbc.Driver
+ servlet:
+ multipart:
+ max-file-size: 100MB
+ max-request-size: 100MB
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: Asia/Shanghai
@@ -17,7 +31,8 @@
type-aliases-package: com.trafficaudit
configuration:
map-underscore-to-camel-case: true
- log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+ # 鏄惧紡鎸囧畾 Slf4j锛歁yBatis-Plus 榛樿 StdOutImpl 浼氭妸鏁磋鏁版嵁锛堝惈浼佷笟鍚�/鐢佃瘽锛夋墦杩涙棩蹇�
+ log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
global-config:
db-config:
id-type: auto
@@ -29,7 +44,35 @@
secret: ${JWT_SECRET:change-me-jwt-secret}
expiration: 86400000
+docs:
+ template-root: docs
+
+city-passenger:
+ template-dir: docs/鍩庡競瀹㈣繍
+
+passenger:
+ template-dir: docs/鍏矾鏃呭
+
+freight:
+ template-dir: docs/璐ц繍
+
+energy:
+ template-dir: docs/鑳借��
+
+investment:
+ template-dir: docs/鎶曡祫/妯℃澘
+
deepseek:
api-key: ${DEEPSEEK_API_KEY:your-deepseek-api-key}
api-url: https://api.deepseek.com/v1/chat/completions
model: deepseek-chat
+
+# Behavior captcha on login. Set to false to skip verification during test phase; enable before production release.
+app:
+ cors:
+ # 鍏佽璺ㄥ煙璁块棶鎺ュ彛鐨勬潵婧愶紙閫楀彿鍒嗛殧锛屾敮鎸� * 閫氶厤涓绘満涓庣鍙o級锛�
+ # 娴忚鍣� POST/PUT/DELETE 蹇呭甫 Origin锛圙ET 涓嶅甫锛夛紝鏁呯敤 IP/鍩熷悕鎵撳紑椤甸潰鏃惰鏉ユ簮蹇呴』鍛戒腑姝ゅ垪琛紝鍚﹀垯 403銆�
+ # 榛樿鏀捐鏈満涓庡唴缃戠綉娈碉紱鑻ラ�氳繃鍩熷悕璁块棶锛岃鎶婅鍩熷悕锛堝惈绔彛锛夎拷鍔犲埌姝ゅ銆�
+ allowed-origins: http://localhost:*,http://127.0.0.1:*,http://192.168.*:*,http://10.*:*,http://172.*:*
+ captcha:
+ required: false
--
Gitblit v1.9.1