diff --git a/fund-admin/src/api/request.ts b/fund-admin/src/api/request.ts index 3f8568f..109db53 100644 --- a/fund-admin/src/api/request.ts +++ b/fund-admin/src/api/request.ts @@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus' // 创建axios实例 const service: AxiosInstance = axios.create({ - baseURL: '', + baseURL: '/fund', timeout: 15000, headers: { 'Content-Type': 'application/json' diff --git a/fund-gateway/src/main/resources/application.yml b/fund-gateway/src/main/resources/application.yml index 332b3f5..ba3a9eb 100644 --- a/fund-gateway/src/main/resources/application.yml +++ b/fund-gateway/src/main/resources/application.yml @@ -63,65 +63,65 @@ spring: - id: fund-sys uri: lb://fund-sys predicates: - - Path=/sys/** + - Path=/fund/sys/** filters: - - StripPrefix=1 + - StripPrefix=2 # 客户管理服务 - id: fund-cust uri: lb://fund-cust predicates: - - Path=/cust/** + - Path=/fund/cust/** filters: - - StripPrefix=1 + - StripPrefix=2 # 项目管理服务 - id: fund-proj uri: lb://fund-proj predicates: - - Path=/proj/** + - Path=/fund/proj/** filters: - - StripPrefix=1 + - StripPrefix=2 # 用款申请服务 - id: fund-req uri: lb://fund-req predicates: - - Path=/req/** + - Path=/fund/req/** filters: - - StripPrefix=1 + - StripPrefix=2 # 支出管理服务 - id: fund-exp uri: lb://fund-exp predicates: - - Path=/exp/** + - Path=/fund/exp/** filters: - - StripPrefix=1 + - StripPrefix=2 # 收款管理服务 - id: fund-receipt uri: lb://fund-receipt predicates: - - Path=/receipt/** + - Path=/fund/receipt/** filters: - - StripPrefix=1 + - StripPrefix=2 # 报表服务 - id: fund-report uri: lb://fund-report predicates: - - Path=/report/** + - Path=/fund/report/** filters: - - StripPrefix=1 + - StripPrefix=2 # 文件服务 - id: fund-file uri: lb://fund-file predicates: - - Path=/file/** + - Path=/fund/file/** filters: - - StripPrefix=1 + - StripPrefix=2 # 多租户路由配置 tenant: diff --git a/fund-mobile/src/api/request.ts b/fund-mobile/src/api/request.ts index d2a4c0b..7b9b96c 100644 --- a/fund-mobile/src/api/request.ts +++ b/fund-mobile/src/api/request.ts @@ -1,7 +1,7 @@ import axios from 'axios' const request = axios.create({ - baseURL: '', + baseURL: '/fund', timeout: 15000, headers: { 'Content-Type': 'application/json' diff --git a/scripts/deploy-frontend-nginx.sh b/scripts/deploy-frontend-nginx.sh index c37d4d5..ca025bd 100755 --- a/scripts/deploy-frontend-nginx.sh +++ b/scripts/deploy-frontend-nginx.sh @@ -96,7 +96,24 @@ server { add_header Cache-Control "public, immutable"; } - # API代理到网关 + # API代理到网关(/fund前缀) + location /fund/ { + proxy_pass http://${gateway_host}/fund/; + proxy_set_header Host \$host; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto \$scheme; + + # 超时配置 + proxy_connect_timeout 60s; + proxy_send_timeout 60s; + proxy_read_timeout 60s; + + # 文件上传大小限制 + client_max_body_size 100m; + } + + # 兼容旧版/api代理(可选,逐步迁移后可删除) location /api/ { proxy_pass http://${gateway_host}/; proxy_set_header Host \$host; diff --git a/scripts/env.properties b/scripts/env.properties index 63bae98..c971e69 100644 --- a/scripts/env.properties +++ b/scripts/env.properties @@ -57,8 +57,8 @@ COS_BUCKET_HOST=https://test-1308258046.cos.ap-beijing.myqcloud.com # -------------------------------------------- # 文件上传配置 # -------------------------------------------- -FILE_UPLOAD_MAX_SIZE=50MB -FILE_UPLOAD_MAX_REQUEST_SIZE=100MB +FILE_UPLOAD_MAX_SIZE=52428800 +FILE_UPLOAD_MAX_REQUEST_SIZE=52428800 FILE_STORAGE_PATH=./uploads FILE_STORAGE_MAX_BYTES=52428800