Browse Source

fix(cert): 修复证书文件路径问题

- 移除了上传路径末尾的斜杠
- 更新了证书路径相关的文档和脚本
- 调整了开发和生产环境配置中的上传路径
pan
科技小王子 3 weeks ago
parent
commit
c96bc5efea
  1. 2
      docs/CERTIFICATE_PATH_FIX_SUMMARY.md
  2. 6
      src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java
  3. 2
      src/main/resources/application-dev.yml
  4. 2
      src/main/resources/application-prod.yml
  5. 4
      src/main/resources/application.yml
  6. 6
      src/main/resources/scripts/check_cert_paths.sh

2
docs/CERTIFICATE_PATH_FIX_SUMMARY.md

@ -136,7 +136,7 @@ public Config createDefaultDevConfig() {
**示例**: **示例**:
- 配置文件upload-path: `/www/wwwroot/file.ws/` - 配置文件upload-path: `/www/wwwroot/file.ws/`
- 数据库相对路径: `wechat/10550/apiclient_key.pem` - 数据库相对路径: `wechat/10550/apiclient_key.pem`
- 最终证书路径: `/www/wwwroot/file.ws/file/wechat/10550/apiclient_key.pem`
- 最终证书路径: `/www/wwwroot/file.ws/wechat/10550/apiclient_key.pem`
## 证书文件验证 ## 证书文件验证

6
src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java

@ -1,19 +1,15 @@
package com.gxwebsoft.hjm.controller; package com.gxwebsoft.hjm.controller;
import cn.hutool.core.util.StrUtil; 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.config.ConfigProperties;
import com.gxwebsoft.common.core.utils.FileServerUtil; import com.gxwebsoft.common.core.utils.FileServerUtil;
import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.FileRecord; import com.gxwebsoft.common.system.entity.FileRecord;
import com.gxwebsoft.common.system.service.FileRecordService;
import com.gxwebsoft.hjm.service.HjmBxLogService; import com.gxwebsoft.hjm.service.HjmBxLogService;
import com.gxwebsoft.hjm.entity.HjmBxLog; import com.gxwebsoft.hjm.entity.HjmBxLog;
import com.gxwebsoft.hjm.param.HjmBxLogParam; import com.gxwebsoft.hjm.param.HjmBxLogParam;
import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult; 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.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog; import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.common.system.entity.User;
@ -168,7 +164,7 @@ public class HjmBxLogController extends BaseController {
* 文件上传位置(服务器) * 文件上传位置(服务器)
*/ */
private String getUploadDir() { private String getUploadDir() {
return config.getUploadPath() + "file/";
return config.getUploadPath();
} }
} }

2
src/main/resources/application-dev.yml

@ -48,7 +48,7 @@ mqtt:
config: config:
# 开发环境接口 # 开发环境接口
server-url: https://server.websoft.top/api 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配置
jwt: jwt:

2
src/main/resources/application-prod.yml

@ -49,7 +49,7 @@ config:
file-server: https://file-s209.shoplnk.cn file-server: https://file-s209.shoplnk.cn
# 生产环境接口 # 生产环境接口
server-url: https://server.websoft.top/api server-url: https://server.websoft.top/api
upload-path: /www/wwwroot/file.ws/
upload-path: /www/wwwroot/file.ws
# 阿里云OSS云存储 # 阿里云OSS云存储
endpoint: https://oss-cn-shenzhen.aliyuncs.com endpoint: https://oss-cn-shenzhen.aliyuncs.com

4
src/main/resources/application.yml

@ -102,8 +102,8 @@ config:
file-server: https://file.websoft.top file-server: https://file.websoft.top
# 其他 # 其他
api-url: https://server.websoft.top/api 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云存储 # 阿里云OSS云存储
endpoint: https://oss-cn-shenzhen.aliyuncs.com endpoint: https://oss-cn-shenzhen.aliyuncs.com

6
src/main/resources/scripts/check_cert_paths.sh

@ -6,7 +6,7 @@ echo "=== 检查证书文件路径 ==="
# 基础路径 # 基础路径
CERT_ROOT="/www/wwwroot/file.ws" CERT_ROOT="/www/wwwroot/file.ws"
FILE_BASE="$CERT_ROOT/file"
FILE_BASE="$CERT_ROOT"
echo "证书根路径: $CERT_ROOT" echo "证书根路径: $CERT_ROOT"
echo "文件基础路径: $FILE_BASE" echo "文件基础路径: $FILE_BASE"
@ -45,7 +45,7 @@ echo "=== 查找所有.p12文件 ==="
find "$CERT_ROOT" -name "*.p12" -type f 2>/dev/null | head -20 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 "=== 检查特定文件 ===" echo "=== 检查特定文件 ==="
echo "文件路径: $SPECIFIC_FILE" echo "文件路径: $SPECIFIC_FILE"
@ -54,7 +54,7 @@ if [ -f "$SPECIFIC_FILE" ]; then
echo "文件大小: $(stat -c%s "$SPECIFIC_FILE") bytes" echo "文件大小: $(stat -c%s "$SPECIFIC_FILE") bytes"
echo "文件权限: $(stat -c%A "$SPECIFIC_FILE")" echo "文件权限: $(stat -c%A "$SPECIFIC_FILE")"
echo "文件所有者: $(stat -c%U:%G "$SPECIFIC_FILE")" echo "文件所有者: $(stat -c%U:%G "$SPECIFIC_FILE")"
# 检查文件内容 # 检查文件内容
echo "" echo ""
echo "文件前3行:" echo "文件前3行:"

Loading…
Cancel
Save