Files
AI_OJ/aioj-backend-gateway/src/main/resources/application-dev.yml
meowrain a4575cebd4 refactor: 重构安全架构,提取通用安全模块到common-security
- 将JwtAuthenticationFilter、JwtUtil、JwtProperties从auth服务移至common-security模块
- 新增common-security通用安全模块,提供JWT认证、权限验证等核心安全功能
- 重命名SecurityConfiguration为AuthSecurityConfiguration,使用common-security的filter
- 新增JacksonConfiguration配置类,统一JSON序列化配置
- 新增头像更新功能AvatarUpdateRequestDTO
- 移除冗余的UserLoginResponseDTO类
- 更新各服务模块的依赖配置以引入common-security模块
- 新增README.md项目说明文档

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 01:54:21 +08:00

99 lines
2.3 KiB
YAML

spring:
data:
redis:
host: 10.0.0.10
port: 6379
password: 123456
cloud:
nacos:
discovery:
enabled: true
register-enabled: false
server-addr: 10.0.0.10:8848
username: nacos
password: nacos
config:
enabled: false
import-check:
enabled: false
gateway:
# Gateway 发现定位器配置
server:
webflux:
discovery:
locator:
enabled: true
lower-case-service-id: true
loadbalancer:
nacos:
enabled: true
retry:
enabled: true
max-retries-on-same-service-instance: 1
max-retries-on-next-service-instance: 2
cache:
enabled: true
ttl: 35s
health-check:
initial-delay: 0ms
interval: 30s
aioj-backend-gateway:
# 白名单配置
white-list:
- /api/v1/user/email/send-code
- /api/file/**
- /api/v1/auth/login
- /api/v1/auth/register
- /api/v1/auth/refresh
- /api/v1/user/register
- /api/v1/user/info
- /api/v1/question/list
- /api/v1/question/detail/**
- /actuator/health
- /swagger-ui/**
- /doc.html
- /doc.html/**
- /webjars/**
- /v3/api-docs/**
- /**/v3/api-docs/**
- /auth-service/**
- /user-service/**
logging:
level:
root: INFO
# Nacos 相关日志
com.alibaba.nacos: INFO
com.alibaba.cloud.nacos: INFO
# LoadBalancer 日志
org.springframework.cloud.loadbalancer: INFO
# Gateway 日志 - 改为 INFO 减少输出,需要调试时改回 DEBUG
org.springframework.cloud.gateway: INFO
# 自定义过滤器日志
cn.meowrain.aioj.backend.gateway: DEBUG
knife4j:
gateway:
enabled: true
tags-sorter: alpha
operations-sorter: alpha
strategy: manual
routes:
- name: 认证服务
service-name: auth-service
url: /auth-service/api/v3/api-docs
context-path: /auth-service
order: 1
- name: 用户服务
service-name: user-service
url: /user-service/api/v3/api-docs
context-path: /user-service
order: 2
- name: 文件服务
service-name: file-service
url: /file-service/api/v3/api-docs
context-path: /file-service
order: 2