From c96bc5efea4788cc3d35e8b4dc21438828a41bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 9 Sep 2025 17:03:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(cert):=20=E4=BF=AE=E5=A4=8D=E8=AF=81?= =?UTF-8?q?=E4=B9=A6=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了上传路径末尾的斜杠 - 更新了证书路径相关的文档和脚本 - 调整了开发和生产环境配置中的上传路径 --- docs/CERTIFICATE_PATH_FIX_SUMMARY.md | 2 +- .../com/gxwebsoft/hjm/controller/HjmBxLogController.java | 6 +----- src/main/resources/application-dev.yml | 2 +- src/main/resources/application-prod.yml | 2 +- src/main/resources/application.yml | 4 ++-- src/main/resources/scripts/check_cert_paths.sh | 6 +++--- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/docs/CERTIFICATE_PATH_FIX_SUMMARY.md b/docs/CERTIFICATE_PATH_FIX_SUMMARY.md index a3aed20..8dbbeb2 100644 --- a/docs/CERTIFICATE_PATH_FIX_SUMMARY.md +++ b/docs/CERTIFICATE_PATH_FIX_SUMMARY.md @@ -136,7 +136,7 @@ public Config createDefaultDevConfig() { **示例**: - 配置文件upload-path: `/www/wwwroot/file.ws/` - 数据库相对路径: `wechat/10550/apiclient_key.pem` -- 最终证书路径: `/www/wwwroot/file.ws/file/wechat/10550/apiclient_key.pem` +- 最终证书路径: `/www/wwwroot/file.ws/wechat/10550/apiclient_key.pem` ## 证书文件验证 diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java index 7456c7a..8d8b8a8 100644 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java +++ b/src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java @@ -1,19 +1,15 @@ package com.gxwebsoft.hjm.controller; import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.gxwebsoft.common.core.config.ConfigProperties; import com.gxwebsoft.common.core.utils.FileServerUtil; import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.common.system.entity.FileRecord; -import com.gxwebsoft.common.system.service.FileRecordService; import com.gxwebsoft.hjm.service.HjmBxLogService; import com.gxwebsoft.hjm.entity.HjmBxLog; import com.gxwebsoft.hjm.param.HjmBxLogParam; import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.PageParam; import com.gxwebsoft.common.core.web.BatchParam; import com.gxwebsoft.common.core.annotation.OperationLog; import com.gxwebsoft.common.system.entity.User; @@ -168,7 +164,7 @@ public class HjmBxLogController extends BaseController { * 文件上传位置(服务器) */ private String getUploadDir() { - return config.getUploadPath() + "file/"; + return config.getUploadPath(); } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index c28b126..7dec873 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -48,7 +48,7 @@ mqtt: config: # 开发环境接口 server-url: https://server.websoft.top/api - upload-path: /Users/gxwebsoft/JAVA/mp-java/src/main/resources/ # window(D:\Temp) + upload-path: /Users/gxwebsoft/JAVA/mp-java/src/main/resources # window(D:\Temp) # JWT配置 jwt: diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 557caab..4ad0fb1 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -49,7 +49,7 @@ config: file-server: https://file-s209.shoplnk.cn # 生产环境接口 server-url: https://server.websoft.top/api - upload-path: /www/wwwroot/file.ws/ + upload-path: /www/wwwroot/file.ws # 阿里云OSS云存储 endpoint: https://oss-cn-shenzhen.aliyuncs.com diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e054190..29a58d2 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -102,8 +102,8 @@ config: file-server: https://file.websoft.top # 其他 api-url: https://server.websoft.top/api - upload-path: /Users/gxwebsoft/Documents/uploads/ - local-upload-path: /Users/gxwebsoft/Documents/uploads/ + upload-path: /Users/gxwebsoft/Documents/uploads + local-upload-path: /Users/gxwebsoft/Documents/uploads # 阿里云OSS云存储 endpoint: https://oss-cn-shenzhen.aliyuncs.com diff --git a/src/main/resources/scripts/check_cert_paths.sh b/src/main/resources/scripts/check_cert_paths.sh index c3d0274..48aad98 100644 --- a/src/main/resources/scripts/check_cert_paths.sh +++ b/src/main/resources/scripts/check_cert_paths.sh @@ -6,7 +6,7 @@ echo "=== 检查证书文件路径 ===" # 基础路径 CERT_ROOT="/www/wwwroot/file.ws" -FILE_BASE="$CERT_ROOT/file" +FILE_BASE="$CERT_ROOT" echo "证书根路径: $CERT_ROOT" echo "文件基础路径: $FILE_BASE" @@ -45,7 +45,7 @@ echo "=== 查找所有.p12文件 ===" find "$CERT_ROOT" -name "*.p12" -type f 2>/dev/null | head -20 # 检查特定文件 -SPECIFIC_FILE="/www/wwwroot/file.ws/file/20250727/c27fe16e08314431a56c3489818af64f.pem" +SPECIFIC_FILE="/www/wwwroot/file.ws/20250727/c27fe16e08314431a56c3489818af64f.pem" echo "" echo "=== 检查特定文件 ===" echo "文件路径: $SPECIFIC_FILE" @@ -54,7 +54,7 @@ if [ -f "$SPECIFIC_FILE" ]; then echo "文件大小: $(stat -c%s "$SPECIFIC_FILE") bytes" echo "文件权限: $(stat -c%A "$SPECIFIC_FILE")" echo "文件所有者: $(stat -c%U:%G "$SPECIFIC_FILE")" - + # 检查文件内容 echo "" echo "文件前3行:"