diff --git a/doc/implementation-report-2026-03-30-backend-port-63310.md b/doc/implementation-report-2026-03-30-backend-port-63310.md new file mode 100644 index 0000000..d309e69 --- /dev/null +++ b/doc/implementation-report-2026-03-30-backend-port-63310.md @@ -0,0 +1,13 @@ +# 后端端口调整为 63310 实施记录 + +## 修改内容 +- 将 `ruoyi-admin` 的 `dev`、`uat`、`pro` 环境 `server.port` 统一调整为 `63310`。 +- 将后端模型调用配置 `model.url` 同步改为 `http://localhost:63310/rate/pricing/mock/invokeModel`,避免应用内部仍回调旧端口。 +- 将前端本地开发代理 `ruoyi-ui/vue.config.js` 的后端目标端口同步改为 `63310`。 +- 将 `test_api` 下的 Shell 脚本与 `.http` 示例请求地址统一改为 `http://localhost:63310`。 + +## 验证结果 +- 执行 `./bin/restart_java_backend.sh restart`,构建与重启成功,启动日志显示开发环境实际监听端口为 `http-nio-63310`。 +- 执行 `lsof -iTCP:63310 -sTCP:LISTEN`,确认 Java 进程已监听 `63310` 端口。 +- 执行 `curl -sS -X POST http://localhost:63310/login/test -H 'Content-Type: application/json' -d '{"username":"admin","password":"admin123"}'`,返回 `{"code":200,...}`,确认新端口可正常访问登录测试接口。 +- 执行 `./bin/restart_java_backend.sh stop` 后再次检查 `./bin/restart_java_backend.sh status` 与 `lsof -iTCP:63310 -sTCP:LISTEN`,确认本次验证启动的后端进程已停止。 diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 3b96989..ccf100f 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -1,7 +1,7 @@ # 开发环境配置 server: - # 服务器的HTTP端口,默认为8080 - port: 8080 + # 服务器的HTTP端口,默认为63310 + port: 63310 servlet: # 应用的访问路径 context-path: / @@ -79,7 +79,7 @@ spring: config: multi-statement-allow: true model: - url: http://localhost:8080/rate/pricing/mock/invokeModel + url: http://localhost:63310/rate/pricing/mock/invokeModel security: password-transfer: diff --git a/ruoyi-admin/src/main/resources/application-pro.yml b/ruoyi-admin/src/main/resources/application-pro.yml new file mode 100644 index 0000000..a9ddf47 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application-pro.yml @@ -0,0 +1,86 @@ +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为63310 + port: 63310 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # 连接数满后的排队数,默认为100 + accept-count: 1000 + threads: + # tomcat最大线程数,默认为200 + max: 800 + # Tomcat启动初始化的线程数,默认值10 + min-spare: 100 + + +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://64.127.23.6:3306/loan-pricing?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: lrdb + password: Synx@2024 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true +model: + url: http://localhost:63310/rate/pricing/mock/invokeModel + +security: + password-transfer: + key: "1234567890abcdef" diff --git a/ruoyi-admin/src/main/resources/application-uat.yml b/ruoyi-admin/src/main/resources/application-uat.yml new file mode 100644 index 0000000..452ef82 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application-uat.yml @@ -0,0 +1,86 @@ +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为63310 + port: 63310 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # 连接数满后的排队数,默认为100 + accept-count: 1000 + threads: + # tomcat最大线程数,默认为200 + max: 800 + # Tomcat启动初始化的线程数,默认值10 + min-spare: 100 + + +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://192.168.0.111:40628/loan-pricing?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: Kfcx@1234 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true +model: + url: http://localhost:63310/rate/pricing/mock/invokeModel + +security: + password-transfer: + key: "1234567890abcdef" diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 40e140d..39dd8bb 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin') const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 -const baseUrl = 'http://localhost:8080' // 后端接口 +const baseUrl = 'http://localhost:63310' // 后端接口 const port = process.env.port || process.env.npm_config_port || 80 // 端口 diff --git a/test_api/test_corporate_create.http b/test_api/test_corporate_create.http index ae69f14..62afb4a 100644 --- a/test_api/test_corporate_create.http +++ b/test_api/test_corporate_create.http @@ -6,7 +6,7 @@ ### ============================================================ ### 1. 获取测试 Token(如果未获取) ### ============================================================ -POST http://localhost:8080/login/test +POST http://localhost:63310/login/test Content-Type: application/json { @@ -25,7 +25,7 @@ Content-Type: application/json ### ============================================================ ### 2. 企业客户发起 - 成功场景(完整必填字段) ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json @@ -55,7 +55,7 @@ Content-Type: application/json ### ============================================================ ### 3. 企业客户发起 - 缺少必填字段 custIsn ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json @@ -77,7 +77,7 @@ Content-Type: application/json ### ============================================================ ### 4. 企业客户发起 - 缺少必填字段 guarType ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json @@ -99,7 +99,7 @@ Content-Type: application/json ### ============================================================ ### 5. 企业客户发起 - 缺少必填字段 applyAmt ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json @@ -121,7 +121,7 @@ Content-Type: application/json ### ============================================================ ### 6. 企业客户发起 - 担保方式枚举验证失败 ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json @@ -144,7 +144,7 @@ Content-Type: application/json ### ============================================================ ### 7. 企业客户发起 - 包含省农担担保贷款标识 ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json @@ -170,7 +170,7 @@ Content-Type: application/json ### ============================================================ ### 8. 企业客户发起 - 贸易和建筑业企业标识 ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json @@ -196,7 +196,7 @@ Content-Type: application/json ### ============================================================ ### 9. 企业客户发起 - 所有字段必填(信用贷款场景) ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/corporate +POST http://localhost:63310/loanPricing/workflow/create/corporate Authorization: Bearer {{token}} Content-Type: application/json diff --git a/test_api/test_corporate_create.sh b/test_api/test_corporate_create.sh index cfea5a5..0ec0055 100644 --- a/test_api/test_corporate_create.sh +++ b/test_api/test_corporate_create.sh @@ -6,7 +6,7 @@ # ============================================================ # 配置 -BASE_URL="http://localhost:8080" +BASE_URL="http://localhost:63310" LOGIN_URL="${BASE_URL}/login/test" CORPORATE_CREATE_URL="${BASE_URL}/loanPricing/workflow/create/corporate" diff --git a/test_api/test_personal_create.http b/test_api/test_personal_create.http index e28a250..a979120 100644 --- a/test_api/test_personal_create.http +++ b/test_api/test_personal_create.http @@ -6,7 +6,7 @@ ### ============================================================ ### 1. 获取测试 Token ### ============================================================ -POST http://localhost:8080/login/test +POST http://localhost:63310/login/test Content-Type: application/json { @@ -25,7 +25,7 @@ Content-Type: application/json ### ============================================================ ### 2. 个人客户发起 - 成功场景(完整必填字段) ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/personal +POST http://localhost:63310/loanPricing/workflow/create/personal Authorization: Bearer {{token}} Content-Type: application/json @@ -52,7 +52,7 @@ Content-Type: application/json ### ============================================================ ### 3. 个人客户发起 - 缺少必填字段 custIsn ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/personal +POST http://localhost:63310/loanPricing/workflow/create/personal Authorization: Bearer {{token}} Content-Type: application/json @@ -74,7 +74,7 @@ Content-Type: application/json ### ============================================================ ### 4. 个人客户发起 - 缺少必填字段 guarType ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/personal +POST http://localhost:63310/loanPricing/workflow/create/personal Authorization: Bearer {{token}} Content-Type: application/json @@ -96,7 +96,7 @@ Content-Type: application/json ### ============================================================ ### 5. 个人客户发起 - 缺少必填字段 applyAmt ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/personal +POST http://localhost:63310/loanPricing/workflow/create/personal Authorization: Bearer {{token}} Content-Type: application/json @@ -118,7 +118,7 @@ Content-Type: application/json ### ============================================================ ### 6. 个人客户发起 - 担保方式枚举验证失败 ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/personal +POST http://localhost:63310/loanPricing/workflow/create/personal Authorization: Bearer {{token}} Content-Type: application/json @@ -141,7 +141,7 @@ Content-Type: application/json ### ============================================================ ### 7. 个人客户发起 - 包含抵质押信息 ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/personal +POST http://localhost:63310/loanPricing/workflow/create/personal Authorization: Bearer {{token}} Content-Type: application/json @@ -170,7 +170,7 @@ Content-Type: application/json ### ============================================================ ### 8. 个人客户发起 - 所有字段必填(质押贷款场景) ### ============================================================ -POST http://localhost:8080/loanPricing/workflow/create/personal +POST http://localhost:63310/loanPricing/workflow/create/personal Authorization: Bearer {{token}} Content-Type: application/json diff --git a/test_api/test_personal_create.sh b/test_api/test_personal_create.sh index e3fd434..fac6647 100644 --- a/test_api/test_personal_create.sh +++ b/test_api/test_personal_create.sh @@ -6,7 +6,7 @@ # ============================================================ # 配置 -BASE_URL="http://localhost:8080" +BASE_URL="http://localhost:63310" LOGIN_URL="${BASE_URL}/login/test" PERSONAL_CREATE_URL="${BASE_URL}/loanPricing/workflow/create/personal"