From fb27f94deb516ca2217e8a62170a3fe450cffcc1 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Sat, 7 Nov 2026 23:49:26 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=88=86=E7=BB=84=E5=88=87=E6=8D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 运行参数下账号与登录、门店经营两组由纵向堆叠改为按钮切换,默认账号与登录;切换仅更新选中态与渲染内容,字段值均在页面级状态中,未保存内容不丢失。 --- .../src/views/admin/SystemSettingsView.vue | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue index 835d954d..af2f9dab 100644 --- a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue +++ b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue @@ -32,7 +32,7 @@
-
+

账号与登录

@@ -87,7 +87,7 @@
-
+

门店经营

SHOP
@@ -782,6 +782,8 @@ const toggleProbeDetail = (service: string, operation: string) => { } const activeGroup = ref('') +/** activeRuntimeGroup switches the runtime groups so only one is rendered at a time. */ +const activeRuntimeGroup = ref('settings-group-account') /** activeServiceGroup switches the five service groups so only one is rendered at a time. */ const activeServiceGroup = ref('settings-group-probe') const groupNavItems = computed>(() => { @@ -836,12 +838,21 @@ const handleGroupNavClick = (id: string) => { activeGroup.value = id return } + if (activeSection.value === 'runtime') { + activeRuntimeGroup.value = id + activeGroup.value = id + return + } scrollToGroup(id) } watch(activeSection, () => { - activeGroup.value = activeSection.value === 'services' - ? activeServiceGroup.value - : groupNavItems.value[0]?.id || '' + if (activeSection.value === 'services') { + activeGroup.value = activeServiceGroup.value + } else if (activeSection.value === 'runtime') { + activeGroup.value = activeRuntimeGroup.value + } else { + activeGroup.value = groupNavItems.value[0]?.id || '' + } }, { immediate: true }) const runProbe = async (service: string, operation: string) => { const key = `${service}:${operation}` -- 2.54.0 From 98308928e23c9c42ee656b29b2e31651dc2b7d6b Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Sun, 8 Nov 2026 00:17:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=9B=9E=E6=BA=AF=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=9AMinIO=20=E9=A2=84=E7=AD=BE=E5=90=8D=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BB=8E=E5=86=85=E7=BD=91=E7=AB=AF=E7=82=B9?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=EF=BC=8C=E9=81=BF=E5=85=8D=E5=85=AC=E7=BD=91?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=20DNS=20=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/config/MinioStorageConfig.java | 27 ++++++-- .../impl/MinioObjectStorageProvider.java | 65 ++++++++++++++++++- .../impl/MinioObjectStorageProviderTest.java | 38 +++++++++++ 3 files changed, 123 insertions(+), 7 deletions(-) diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/config/MinioStorageConfig.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/config/MinioStorageConfig.java index 2d1045f0..fba44294 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/config/MinioStorageConfig.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/config/MinioStorageConfig.java @@ -28,6 +28,12 @@ public class MinioStorageConfig { */ private String publicEndpoint; + /** + * Optional MinIO region used when signing URLs. When blank, the region is resolved once + * through the internal endpoint so that signing never depends on public DNS. + */ + private String region; + private String bucketName; private String accessKey; @@ -43,22 +49,33 @@ public class MinioStorageConfig { return buildClient(endpoint); } - public MinioClient createSigningClient() { + /** + * Builds the client used to sign URLs. The region must be passed explicitly, otherwise the + * MinIO SDK queries the endpoint for the bucket region before signing. + */ + public MinioClient createSigningClient(String signingRegion) { if (!Boolean.TRUE.equals(enabled) || !StringUtils.hasText(publicEndpoint)) { return null; } - return buildClient(publicEndpoint); + return buildClient(publicEndpoint, signingRegion); } private MinioClient buildClient(String clientEndpoint) { + return buildClient(clientEndpoint, null); + } + + private MinioClient buildClient(String clientEndpoint, String clientRegion) { if (!StringUtils.hasText(clientEndpoint) || !StringUtils.hasText(accessKey) || !StringUtils.hasText(secretKey)) { throw new IllegalStateException("MinIO is enabled but endpoint/accessKey/secretKey is incomplete"); } - return MinioClient.builder() + MinioClient.Builder builder = MinioClient.builder() .endpoint(clientEndpoint) - .credentials(accessKey, secretKey) - .build(); + .credentials(accessKey, secretKey); + if (StringUtils.hasText(clientRegion)) { + builder.region(clientRegion.trim()); + } + return builder.build(); } } diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProvider.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProvider.java index 2fdd8957..9ccdafa7 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProvider.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProvider.java @@ -17,6 +17,8 @@ import org.springframework.util.StringUtils; import java.io.InputStream; import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; @Slf4j @Service @@ -24,10 +26,20 @@ public class MinioObjectStorageProvider implements ObjectStorageProvider { private static final long UNKNOWN_SIZE_PART_SIZE = 10 * 1024 * 1024L; + /** + * Region probe key: only used to compute a signature locally, no object is written or read. + */ + private static final String REGION_PROBE_OBJECT = "integration-probe/region-probe.txt"; + + private static final Pattern CREDENTIAL_SCOPE = Pattern.compile( + "X-Amz-Credential=[^&]*?%2F\\d{8}%2F([^%&]+)%2Fs3%2Faws4_request", Pattern.CASE_INSENSITIVE); + private final ObjectProvider minioClientProvider; private final MinioClient signingClient; private final MinioStorageConfig minioStorageConfig; private final ObjectStorageProperties objectStorageProperties; + private volatile MinioClient resolvedSigningClient; + private volatile String resolvedSigningRegion; @Autowired public MinioObjectStorageProvider( @@ -35,7 +47,7 @@ public class MinioObjectStorageProvider implements ObjectStorageProvider { MinioStorageConfig minioStorageConfig, ObjectStorageProperties objectStorageProperties ) { - this(minioClientProvider, minioStorageConfig, objectStorageProperties, minioStorageConfig.createSigningClient()); + this(minioClientProvider, minioStorageConfig, objectStorageProperties, null); } MinioObjectStorageProvider( @@ -107,7 +119,7 @@ public class MinioObjectStorageProvider implements ObjectStorageProvider { if (!Boolean.TRUE.equals(minioStorageConfig.getPrivateBucket())) { return getFileUrl(objectName); } - return (signingClient == null ? requireClient() : signingClient).getPresignedObjectUrl( + return signingClientForPresign().getPresignedObjectUrl( GetPresignedObjectUrlArgs.builder() .method(Method.GET) .bucket(minioStorageConfig.getBucketName()) @@ -117,6 +129,55 @@ public class MinioObjectStorageProvider implements ObjectStorageProvider { ); } + private MinioClient signingClientForPresign() throws Exception { + if (signingClient != null) { + return signingClient; + } + MinioClient cached = resolvedSigningClient; + if (cached != null) { + return cached; + } + synchronized (this) { + if (resolvedSigningClient == null) { + MinioClient client = StringUtils.hasText(minioStorageConfig.getPublicEndpoint()) + ? minioStorageConfig.createSigningClient(resolveSigningRegion()) + : null; + resolvedSigningClient = client == null ? requireClient() : client; + } + return resolvedSigningClient; + } + } + + /** + * Resolves the bucket region through the internal endpoint, so that signing does not depend on + * the public endpoint being resolvable from this host. + */ + private String resolveSigningRegion() throws Exception { + String configured = minioStorageConfig.getRegion(); + if (StringUtils.hasText(configured)) { + return configured.trim(); + } + if (resolvedSigningRegion != null) { + return resolvedSigningRegion; + } + String probeUrl = requireClient().getPresignedObjectUrl( + GetPresignedObjectUrlArgs.builder() + .method(Method.GET) + .bucket(minioStorageConfig.getBucketName()) + .object(REGION_PROBE_OBJECT) + .expiry(1, TimeUnit.MINUTES) + .build() + ); + Matcher matcher = CREDENTIAL_SCOPE.matcher(probeUrl == null ? "" : probeUrl); + if (!matcher.find()) { + throw new IllegalStateException( + "MinIO region cannot be resolved from internal endpoint, please configure minio.region"); + } + resolvedSigningRegion = matcher.group(1); + log.info("MinIO signing region resolved through internal endpoint, region={}", resolvedSigningRegion); + return resolvedSigningRegion; + } + private MinioClient requireClient() { MinioClient minioClient = minioClientProvider.getIfAvailable(); if (minioClient == null) { diff --git a/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProviderTest.java b/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProviderTest.java index 984fdb9d..56eae799 100644 --- a/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProviderTest.java +++ b/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/modules/file/service/impl/MinioObjectStorageProviderTest.java @@ -51,6 +51,44 @@ class MinioObjectStorageProviderTest { verify(signingClient).getPresignedObjectUrl(org.mockito.ArgumentMatchers.any(GetPresignedObjectUrlArgs.class)); } + @Test + void resolvesSigningRegionThroughInternalEndpointInsteadOfPublicEndpoint() throws Exception { + MinioClient internalClient = mock(MinioClient.class); + ObjectProvider internalClientProvider = mock(ObjectProvider.class); + when(internalClientProvider.getIfAvailable()).thenReturn(internalClient); + when(internalClient.getPresignedObjectUrl(org.mockito.ArgumentMatchers.any(GetPresignedObjectUrlArgs.class))) + .thenReturn("http://192.168.10.14:9000/jayucloud-salon-sit/integration-probe/region-probe.txt" + + "?X-Amz-Algorithm=AWS4-HMAC-SHA256" + + "&X-Amz-Credential=access-key%2F20261108%2Fcn-sit-1%2Fs3%2Faws4_request" + + "&X-Amz-Date=20261108T000000Z&X-Amz-Expires=60&X-Amz-SignedHeaders=host" + + "&X-Amz-Signature=probe"); + + MinioStorageConfig config = new MinioStorageConfig(); + config.setEnabled(true); + config.setEndpoint("http://192.168.10.14:9000"); + config.setPublicEndpoint("https://sit.minio.yunail.art"); + config.setAccessKey("access-key"); + config.setSecretKey("secret-key"); + config.setBucketName("jayucloud-salon-sit"); + config.setPrivateBucket(true); + + MinioObjectStorageProvider provider = new MinioObjectStorageProvider( + internalClientProvider, + config, + new ObjectStorageProperties() + ); + + String signedUrl = provider.getPresignedUrl("style.jpg", 60); + String signedAgain = provider.getPresignedUrl("style.jpg", 60); + + assertTrue(signedUrl.startsWith("https://sit.minio.yunail.art/jayucloud-salon-sit/style.jpg?")); + assertTrue(signedUrl.contains("X-Amz-Credential=access-key%2F")); + assertTrue(signedUrl.contains("cn-sit-1%2Fs3%2Faws4_request")); + assertTrue(signedAgain.contains("cn-sit-1%2Fs3%2Faws4_request")); + verify(internalClient, org.mockito.Mockito.times(1)) + .getPresignedObjectUrl(org.mockito.ArgumentMatchers.any(GetPresignedObjectUrlArgs.class)); + } + @Test void usesInternalMinioClientForUploadDownloadAndDelete() throws Exception { MinioClient internalClient = mock(MinioClient.class); -- 2.54.0 From 419eccad794908036e641592b786e485e3f27056 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Sun, 8 Nov 2026 00:21:46 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E8=A1=A5=E5=85=85=20MinIO=20=E9=A2=84?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E5=8C=BA=E5=9F=9F=E8=A7=A3=E6=9E=90=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 说明签名区域改为经内网端点解析、公网签名 URL 语义不变,并在配置总说明登记可选 minio.region。 --- ...储MinIO预签名区域解析配置说明_20261108.md | 51 +++++++++++++++++++ docs/scripts/运行与发布配置总说明.md | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 docs/scripts/Salon对象存储MinIO预签名区域解析配置说明_20261108.md diff --git a/docs/scripts/Salon对象存储MinIO预签名区域解析配置说明_20261108.md b/docs/scripts/Salon对象存储MinIO预签名区域解析配置说明_20261108.md new file mode 100644 index 00000000..ab79e2e1 --- /dev/null +++ b/docs/scripts/Salon对象存储MinIO预签名区域解析配置说明_20261108.md @@ -0,0 +1,51 @@ +# Salon 对象存储 MinIO 预签名区域解析配置说明 + +更新时间:2026-11-08 + +## 1. 问题背景 + +SIT「对象存储三副本·往返测试」中 MinIO 卡在「生成签名地址」阶段,异常为 +`Failed to connect to sit.minio.yunail.art/198.18.220.2:443`。 + +原因:`minio-java` 在生成预签名 URL 前,若未显式指定 region,会先向客户端 endpoint 查询桶所在区域。 +签名客户端使用公网 `public-endpoint`(`https://sit.minio.yunail.art`),该域名在 SIT 上被解析为 +fake-IP(198.18.0.0/15),连接被拒,导致整步失败。 + +## 2. 处理方式 + +- 签名客户端改为**显式指定 region** 后再签名,不再触发向 `public-endpoint` 的 region 查询。 +- region 默认通过**内网 endpoint**(`minio.endpoint`,如 `http://192.168.10.14:9000`)解析一次并缓存: + 用内网客户端对探针对象做一次本地预签名,从生成的 `X-Amz-Credential` 作用域中提取 region。 + 该调用只做签名计算与一次内网 `?location` 查询,不写入、不读取任何对象。 +- 签出的 URL 仍以 `public-endpoint` 为 host,上传、下载、删除继续走内网 `endpoint`,产品语义不变。 +- 支持可选配置 `minio.region`:配置后直接使用该值,不再做内网解析。 + +本次未修改任何环境的 Nacos 配置;`minio.region` 为可选项,默认留空即走内网自动解析。 + +## 3. 配置项 + +| 配置项 | 位置 | 必填 | 说明 | +| --- | --- | --- | --- | +| `minio.endpoint` | `infra.yaml` | 是 | 服务端内网访问地址,也是 region 解析通道 | +| `minio.public-endpoint` | `infra.yaml` | 否 | 仅用于生成客户端签名 URL 的公网地址 | +| `minio.region` | `infra.yaml` | 否 | 显式指定签名 region;留空时按内网解析结果签名 | + +## 4. 验证结果(SIT,未修改 DNS) + +- 内网解析 region:`REGION_RESOLVE=OK region=us-east-1`(首次约 391ms,含内网 `?location` 往返)。 +- 公网 endpoint 签名:`PUBLIC_PRESIGN=OK ms=11`,此时不再发起任何公网 DNS 解析或连接。 +- 签名可用性(绕过 DNS,指定真实 IP + 域名 SNI/证书校验): + `curl --resolve sit.minio.yunail.art:443:8.137.35.61 -w '%{http_code} %{ssl_verify_result}'` + 返回 `404 NoSuchKey`(探针键不存在),说明签名被服务端接受。 +- 反向验证:篡改 `X-Amz-Signature` 后同一请求返回 `403 SignatureDoesNotMatch`,证明上一步的 404 是校验通过后的业务响应。 + +## 5. 边界说明 + +- 「生成签名地址」阶段已不再依赖公网域名解析。 +- 「签名访问」阶段仍依赖公网域名解析:真正的 GET 请求发往 `sit.minio.yunail.art`,DNS 未修复时仍会命中 fake-IP。 +- SIT 的 `*.yunail.art` 解析到 fake-IP 属于环境侧问题,未在本次改动范围内。 + +## 6. 回退方式 + +本次为代码改动,不涉及数据库迁移;回退时使用上一版本应用包即可。 +若需临时绕过内网解析,可在 `infra.yaml` 补充 `minio.region`。 diff --git a/docs/scripts/运行与发布配置总说明.md b/docs/scripts/运行与发布配置总说明.md index e0d297e0..f6c6ceb1 100644 --- a/docs/scripts/运行与发布配置总说明.md +++ b/docs/scripts/运行与发布配置总说明.md @@ -33,7 +33,7 @@ - `gateway.yaml`:Gateway 端口、路由、白名单和网关参数。 - `logging.yaml`:公共日志级别。 -对象存储统一使用 `object-storage.signed-url-expire-minutes`。MinIO `endpoint` 始终指服务端内网访问地址;可选 `public-endpoint` 仅用于生成交给客户端访问的 MinIO 签名 URL,不改变服务端上传、下载、删除和对象读取路径。DEV 不配置该字段时沿用原内网 endpoint;SIT 配置为 `https://sit.minio.yunail.art`。MinIO、七牛和 OSS 的连接配置只保留各自必要字段;私有桶按环境配置 `private-bucket: true`。三套 Salon 环境默认签名有效期为 60 分钟。 +对象存储统一使用 `object-storage.signed-url-expire-minutes`。MinIO `endpoint` 始终指服务端内网访问地址;可选 `public-endpoint` 仅用于生成交给客户端访问的 MinIO 签名 URL,不改变服务端上传、下载、删除和对象读取路径。DEV 不配置该字段时沿用原内网 endpoint;SIT 配置为 `https://sit.minio.yunail.art`。MinIO、七牛和 OSS 的连接配置只保留各自必要字段;私有桶按环境配置 `private-bucket: true`。三套 Salon 环境默认签名有效期为 60 分钟。MinIO 可选 `region`:留空时签名区域经内网 `endpoint` 解析一次并缓存,签名 URL 仍以 `public-endpoint` 为 host,见 `docs/scripts/Salon对象存储MinIO预签名区域解析配置说明_20261108.md`。 后端启动时需要 Nacos 启动引导参数:`NACOS_SERVER_ADDR`、`NACOS_NAMESPACE`、`NACOS_GROUP`、`NACOS_USERNAME`、`NACOS_PASSWORD`。Salon Core 另需由部署环境注入 `SALON_SECURE_CONFIG_MASTER_KEY`,用于数据库安全接入配置的 AES-GCM 加解密;此密钥不放 Nacos、不提交仓库,按环境独立设置,所有同环境 Core 实例保持一致。业务数据库、Redis、RabbitMQ 和对象存储参数仍由 Nacos 提供,不通过应用环境变量覆盖。 -- 2.54.0 From e0154a9edba0e744a136c9ba9498691f80685dfb Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Sun, 8 Nov 2026 00:23:52 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=94=B9=E4=B8=BA1=E5=88=86=E9=92=9F?= =?UTF-8?q?=E7=B2=92=E5=BA=A6=EF=BC=9A=E5=B0=8F=E7=A8=8B=E5=BA=8F=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E6=97=B6=E9=97=B4=E6=BB=9A=E8=BD=AE=E4=B8=8E=E6=97=B6?= =?UTF-8?q?=E6=AE=B5=E5=88=97=E8=A1=A8=E7=94=B115=E5=88=86=E9=92=9F?= =?UTF-8?q?=E4=B8=80=E6=A1=A3=E6=94=B9=E4=B8=BA=E9=80=90=E5=88=86=E9=92=9F?= =?UTF-8?q?=E5=80=99=E9=80=89=EF=BC=8C=E5=88=86=E9=92=9F=E5=8F=AF=E9=80=89?= =?UTF-8?q?00-59=E5=B9=B6=E5=8E=9F=E6=A0=B7=E6=8F=90=E4=BA=A4=E5=9B=9E?= =?UTF-8?q?=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-WeChat/pages/appointment-form/index.js | 7 ++++--- JC-Salon-WeChat/pages/appointment-form/index.wxml | 2 +- JC-Salon-WeChat/pages/appointment-form/unassigned.test.js | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/JC-Salon-WeChat/pages/appointment-form/index.js b/JC-Salon-WeChat/pages/appointment-form/index.js index 136a7a04..3fa51657 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.js +++ b/JC-Salon-WeChat/pages/appointment-form/index.js @@ -10,7 +10,8 @@ const { showActionModal } = require('../../utils/action-modal') const DRAFT_STORAGE_PREFIX = 'managerAppointmentDraft' const DRAFT_TTL_MS = 7 * 24 * 60 * 60 * 1000 const DRAFT_SAVE_DELAY_MS = 400 -const TIME_SLOT_MINUTES = 15 +const TIME_SLOT_MINUTES = 1 +const MINUTE_VALUES = Array.from({ length: 60 }, (_, index) => index) function buildClientRequestId(prefix) { return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 10)}` @@ -419,7 +420,7 @@ function buildTimeWheelState(slots, preferredTime) { : firstAvailableSlot || preferredSlot || slots[0] const hours = Array.from(new Set(slots.map(slot => slot.hour))) const selectedHourIndex = Math.max(0, hours.indexOf(selectedSlot.hour)) - const minuteValues = [0, 15, 30, 45] + const minuteValues = MINUTE_VALUES const minutes = minuteValues.map(minute => { const slot = slots.find(item => item.hour === selectedSlot.hour && item.minute === minute) return { @@ -444,7 +445,7 @@ function buildTimeWheelState(slots, preferredTime) { } function timeWheelStateForHour(slots, hour, selectedMinute) { - const minuteValues = [0, 15, 30, 45] + const minuteValues = MINUTE_VALUES const minutes = minuteValues.map(minute => { const slot = slots.find(item => item.hour === hour && item.minute === minute) return { diff --git a/JC-Salon-WeChat/pages/appointment-form/index.wxml b/JC-Salon-WeChat/pages/appointment-form/index.wxml index 574b029a..d1a61071 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.wxml +++ b/JC-Salon-WeChat/pages/appointment-form/index.wxml @@ -137,7 +137,7 @@ 选择预约时间{{form.appointmentDate}} · {{selectedArtist.name || '待分配'}} · {{form.durationMinutes}}分钟 - + 正在计算可约时间... {{businessHoursMissing && !canManageShopSettings ? '门店营业时间尚未设置,请联系店长完成设置' : timeError}} diff --git a/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js b/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js index e4185048..412bbc8e 100644 --- a/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js +++ b/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js @@ -76,6 +76,8 @@ async function run() { assert.strictEqual(page.data.availableTimeGroups.length > 0, true) assert.strictEqual(page.data.availableTimeGroups[0].times[0].value, '09:30') assert.strictEqual(page.data.timeSelectTip, '请选择预约时间,美甲师可稍后分配') + assert.strictEqual(page.data.timePickerMinutes.length, 60) + assert.strictEqual(page.data.timePickerSlots.some(slot => slot.value === '09:31'), true) const availability = await page.checkAvailability() assert.strictEqual(availability.ok, true) assert.strictEqual(page.data.conflictTip.includes('待分配'), true) -- 2.54.0 From 771625d8cfb3ba921bdc199cd6423f898511820b Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Sun, 8 Nov 2026 00:26:49 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix(salon):=20=E5=8F=96=E6=B6=88=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E5=BF=85=E5=A1=AB=E6=A0=A1=E9=AA=8C=EF=BC=8C?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=BA=97=E9=95=BF=E4=B8=8E=E7=BE=8E=E7=94=B2?= =?UTF-8?q?=E5=B8=88=E7=95=99=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/user/service/impl/UserServiceImpl.java | 3 --- .../user/support/UserProfileFieldSupport.java | 6 ------ JC-Salon-Frontend/src/views/admin/UsersView.vue | 13 ++----------- .../src/views/admin/admin-modal-user-form.test.ts | 3 ++- JC-Salon-WeChat/pages/profile-edit/index.wxml | 2 +- 5 files changed, 5 insertions(+), 22 deletions(-) diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java index 91dd7995..db5c9ab5 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/service/impl/UserServiceImpl.java @@ -433,7 +433,6 @@ public class UserServiceImpl extends ServiceImpl implements if (Integer.valueOf(0).equals(userType)) { ensureCustomerUnique(userDTO.getNickname(), validatedWechatId, validatedPhone); } - UserProfileFieldSupport.requireWechatIdForServiceUser(userType, validatedWechatId); /** * Run business method `ensureShopBindingRequirement`. @@ -840,7 +839,6 @@ public class UserServiceImpl extends ServiceImpl implements } } Integer targetUserType = userDO.getType(); - UserProfileFieldSupport.requireWechatIdForServiceUser(targetUserType, userDO.getWechatId()); if (Integer.valueOf(0).equals(targetUserType)) { String customerPhone = validateCustomerPhone(userDO.getPhone(), false); ensureCustomerUnique(userDO.getNickname(), userDO.getWechatId(), customerPhone, id); @@ -2013,7 +2011,6 @@ public class UserServiceImpl extends ServiceImpl implements if (profileApproved && userDTO.getWechatQrCode() != null) { userDO.setWechatQrCode(qrForUpdate.isEmpty() ? null : qrForUpdate); } - UserProfileFieldSupport.requireWechatIdForServiceUser(userDO.getType(), userDO.getWechatId()); userDO.setUpdateTime(LocalDateTime.now()); boolean updated = userMapper.updateById(userDO) > 0; diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/support/UserProfileFieldSupport.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/support/UserProfileFieldSupport.java index 394a6909..01a3db79 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/support/UserProfileFieldSupport.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/user/support/UserProfileFieldSupport.java @@ -13,10 +13,4 @@ public final class UserProfileFieldSupport { } return value.trim(); } - - public static void requireWechatIdForServiceUser(Integer userType, String wechatId) { - if (Integer.valueOf(2).equals(userType) && !StringUtils.hasText(wechatId)) { - throw new IllegalArgumentException("店长的微信号不能为空"); - } - } } diff --git a/JC-Salon-Frontend/src/views/admin/UsersView.vue b/JC-Salon-Frontend/src/views/admin/UsersView.vue index e4a638ca..24affccf 100644 --- a/JC-Salon-Frontend/src/views/admin/UsersView.vue +++ b/JC-Salon-Frontend/src/views/admin/UsersView.vue @@ -225,9 +225,8 @@ - +
@@ -776,15 +775,7 @@ const formRules = { trigger: 'blur' } ], - wechatId: [{ - validator: async (_rule: unknown, value: string) => { - if ([2, 3].includes(Number(formState.type)) && !value?.trim()) { - return Promise.reject('店长和美甲师必须填写微信号') - } - return Promise.resolve() - }, - trigger: ['blur', 'change'] - }], + wechatId: [], password: [{ validator: async (_rule: unknown, value: string) => { validateOptionalPasswordStrength(value) diff --git a/JC-Salon-Frontend/src/views/admin/admin-modal-user-form.test.ts b/JC-Salon-Frontend/src/views/admin/admin-modal-user-form.test.ts index 6082d794..92baff1e 100644 --- a/JC-Salon-Frontend/src/views/admin/admin-modal-user-form.test.ts +++ b/JC-Salon-Frontend/src/views/admin/admin-modal-user-form.test.ts @@ -64,7 +64,8 @@ describe('admin modal and user form behavior', () => { expect(userFormModal).toContain('value-format="YYYY-MM-DD"') expect(userFormModal).toContain('class="user-date-picker"') expect(usersView).toContain('.user-date-picker') - expect(wechatIdField).toContain(':required="[2, 3].includes(Number(formState.type))"') + expect(wechatIdField).not.toContain(':required') + expect(wechatIdField).toContain('placeholder="选填"') expect(shopIdsField).toContain(':required="Number(formState.type) !== 4"') }) }) diff --git a/JC-Salon-WeChat/pages/profile-edit/index.wxml b/JC-Salon-WeChat/pages/profile-edit/index.wxml index 487202de..98f55995 100644 --- a/JC-Salon-WeChat/pages/profile-edit/index.wxml +++ b/JC-Salon-WeChat/pages/profile-edit/index.wxml @@ -29,7 +29,7 @@ 昵称 手机号{{phoneDisplay}}› - 微信号 + 微信号 个性签名