From 5dfea1a73b451655d505b226d54587db7679f704 Mon Sep 17 00:00:00 2001
From: xiaowang <2161656029@qq.com>
Date: Sat, 7 Nov 2026 20:15:31 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E8=AF=8A=E6=96=AD?=
=?UTF-8?q?=E6=A0=87=E9=A2=98=E8=A1=8C=E8=B0=83=E6=95=B4=E5=88=B7=E6=96=B0?=
=?UTF-8?q?=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
将原有刷新最近结果入口改为刷新并移到汇总徽标左侧,补充请求期间禁用;仍复用只读配置查询,不重新发起外部探测。
---
JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
index 726f376b..d2b4384e 100644
--- a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
+++ b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
@@ -122,9 +122,9 @@
From b1360d9552dda5d6d79e7578cd461abb67548d7a Mon Sep 17 00:00:00 2001
From: xiaowang <2161656029@qq.com>
Date: Sat, 7 Nov 2026 20:21:03 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E8=AF=8A=E6=96=AD?=
=?UTF-8?q?=E5=8E=BB=E9=87=8D=E5=9B=BE=E7=89=87=E5=9B=9E=E8=B0=83=E7=BB=93?=
=?UTF-8?q?=E8=AE=BA=E5=B1=95=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
检查项 detail 与结果 summary 文案完全相同时只保留 summary,避免同一结论重复渲染两次。
---
JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
index d2b4384e..835d954d 100644
--- a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
+++ b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
@@ -163,7 +163,7 @@
{{ check.name }}
{{ probeStatusLabel(check.status) }}
- {{ check.detail }}
+ {{ check.detail }}
From 60e9e1e9d0dc9bb2d685552ad8cc34dd415991b0 Mon Sep 17 00:00:00 2001
From: xiaowang <2161656029@qq.com>
Date: Sat, 7 Nov 2026 21:06:58 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=B9=E8=B1=A1?=
=?UTF-8?q?=E5=AD=98=E5=82=A8=E6=8E=A2=E9=92=88=E7=AD=BE=E5=90=8D=E8=AF=BB?=
=?UTF-8?q?=E5=8F=96=E4=BA=8C=E6=AC=A1=E7=BC=96=E7=A0=81=E5=B9=B6=E8=A1=A5?=
=?UTF-8?q?=E5=85=85=E5=A4=B1=E8=B4=A5=E8=AF=8A=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
签名 URL 改为以 URI 传入 RestTemplate,避免 DefaultUriBuilderFactory 的 URI_COMPONENT 把 %2B/%2F/%3D 二次编码导致 OSS、MinIO 验签失败。probeStorage 失败明细改为记录阶段、异常类型与脱敏后的简短原因,不再统一显示上传或读取失败。新增单测覆盖 URI 原样传参与失败明细含阶段、异常类型且不泄露签名参数。
---
.../impl/IntegrationProbeServiceImpl.java | 52 +++++++++++++-
.../impl/IntegrationProbeServiceImplTest.java | 71 +++++++++++++++++++
2 files changed, 121 insertions(+), 2 deletions(-)
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/system/service/impl/IntegrationProbeServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/system/service/impl/IntegrationProbeServiceImpl.java
index 73546670..183b717e 100644
--- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/system/service/impl/IntegrationProbeServiceImpl.java
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/system/service/impl/IntegrationProbeServiceImpl.java
@@ -25,6 +25,7 @@ import com.xiaowang.jayucloud.salon.core.modules.system.vo.SecureIntegrationConf
import com.xiaowang.jayucloud.salon.core.modules.user.entity.UserDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@@ -33,6 +34,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.core.env.Environment;
import java.io.InputStream;
+import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.ArrayList;
@@ -41,6 +43,8 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
@Slf4j
@Service
@@ -51,6 +55,11 @@ public class IntegrationProbeServiceImpl implements IntegrationProbeService {
private static final String STORAGE = "OBJECT_STORAGE";
private static final String SMS = "SMS";
private static final String SUBSCRIBE = "SUBSCRIBE_MESSAGE";
+ private static final Pattern URL_IN_MESSAGE = Pattern.compile("https?://[^\\s\"'<>]+");
+ private static final Pattern URL_HOST = Pattern.compile("^(https?://[^/?#]+)");
+ private static final Pattern SENSITIVE_PARAM = Pattern.compile(
+ "(?i)(signature|token|access[-_]?key(?:[-_]?id|[-_]?secret)?|secret[-_]?key)=([^&\\s\"']+)");
+ private static final int FAILURE_REASON_MAX_LENGTH = 120;
private final IntegrationProbeResultMapper resultMapper;
private final ObjectMapper objectMapper;
@@ -386,17 +395,26 @@ public class IntegrationProbeServiceImpl implements IntegrationProbeService {
}
enabled++;
boolean cleanupFailed = false;
+ String stage = "上传";
try {
provider.uploadStream(new java.io.ByteArrayInputStream(bytes), bytes.length, "text/plain", objectName);
+ stage = "服务端读取";
try (InputStream input = provider.downloadFile(objectName)) {
boolean same = java.util.Arrays.equals(bytes, input.readAllBytes());
+ stage = "生成签名地址";
String signed = provider.getPresignedUrl(objectName, 5);
- byte[] signedBytes = StringUtils.hasText(signed) ? restTemplate.getForObject(signed, byte[].class) : null;
+ stage = "签名访问";
+ // 传 URI 而不是字符串:字符串重载会经 DefaultUriBuilderFactory 的 URI_COMPONENT 展开,
+ // 把签名参数里的 %2B/%2F/%3D 二次编码成 %252B/%252F/%253D,导致对象存储验签失败。
+ byte[] signedBytes = StringUtils.hasText(signed)
+ ? restTemplate.exchange(URI.create(signed), HttpMethod.GET, null, byte[].class).getBody()
+ : null;
+ stage = "内容比对";
boolean signedRead = java.util.Arrays.equals(bytes, signedBytes);
checks.add(new IntegrationProbeCheckVO(provider.providerCode(), same && signedRead ? "PASS" : "FAIL", same && signedRead ? "上传、读取和签名访问成功" : "对象内容或签名读取不一致"));
}
} catch (Exception exception) {
- checks.add(new IntegrationProbeCheckVO(provider.providerCode(), "FAIL", "上传或读取失败"));
+ checks.add(new IntegrationProbeCheckVO(provider.providerCode(), "FAIL", storageFailureDetail(stage, exception)));
} finally {
try { provider.deleteFile(objectName); }
catch (Exception ignored) { cleanupFailed = true; log.warn("清理对象存储测试文件失败,provider={}", provider.providerCode()); }
@@ -410,6 +428,36 @@ public class IntegrationProbeServiceImpl implements IntegrationProbeService {
}
}
+ private String storageFailureDetail(String stage, Exception exception) {
+ return stage + "失败(" + exception.getClass().getSimpleName() + ":" + describeStorageFailure(exception) + ")";
+ }
+
+ private String describeStorageFailure(Exception exception) {
+ String message = exception.getMessage();
+ if (!StringUtils.hasText(message)) {
+ return "无错误消息";
+ }
+ Matcher urlMatcher = URL_IN_MESSAGE.matcher(message);
+ StringBuffer masked = new StringBuffer();
+ while (urlMatcher.find()) {
+ urlMatcher.appendReplacement(masked, Matcher.quoteReplacement(maskUrl(urlMatcher.group())));
+ }
+ urlMatcher.appendTail(masked);
+ String sanitized = SENSITIVE_PARAM.matcher(masked.toString()).replaceAll("$1=***");
+ sanitized = sanitized.replaceAll("\\s+", " ").trim();
+ return sanitized.length() > FAILURE_REASON_MAX_LENGTH
+ ? sanitized.substring(0, FAILURE_REASON_MAX_LENGTH) + "…"
+ : sanitized;
+ }
+
+ private String maskUrl(String url) {
+ Matcher hostMatcher = URL_HOST.matcher(url);
+ if (hostMatcher.find()) {
+ return hostMatcher.group(1) + "/…";
+ }
+ return "(地址已隐藏)";
+ }
+
private IntegrationProbeResultVO probeSms(UserDO currentUser, String operation, String mode, String phone) {
List