diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptor.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptor.java index 36fd8f17..a09bab7f 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptor.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptor.java @@ -36,6 +36,10 @@ public class AgreementAcceptanceInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + // 后台管理端不参与协议版本校验:平台管理人员登录后台即视为已知悉协议,不产生同意记录、不弹更新提示。 + if (isAdminRequestPath(request.getRequestURI())) { + return true; + } Object userIdAttribute = request.getAttribute("userId"); if (!(userIdAttribute instanceof Number)) { return true; @@ -62,6 +66,16 @@ public class AgreementAcceptanceInterceptor implements HandlerInterceptor { } } + /** + * 判断请求是否属于后台管理端。 + * 网关会把 {@code /api/admin/**} 与 {@code /admin/api/**} 统一改写为 {@code /admin/**} 转发到 Core; + * 另有部分管理端接口以业务前缀 + {@code /admin/**} 暴露(如 {@code /order/admin/**})。 + * 因此只要路径包含 {@code /admin/} 段即视为管理端请求,直接放行。 + */ + private boolean isAdminRequestPath(String path) { + return path != null && path.contains("/admin/"); + } + private void writeAgreementRequired(HttpServletResponse response, Map currentVersions, List pendingTypes) throws Exception { diff --git a/JC-Salon-Core/src/main/resources/db/migration/V21__协议补充后台管理端豁免说明_20261105.sql b/JC-Salon-Core/src/main/resources/db/migration/V21__协议补充后台管理端豁免说明_20261105.sql new file mode 100644 index 00000000..331ced8b --- /dev/null +++ b/JC-Salon-Core/src/main/resources/db/migration/V21__协议补充后台管理端豁免说明_20261105.sql @@ -0,0 +1,28 @@ +-- 协议补充后台管理端豁免说明:仅为澄清性文字补充,不新增协议版本、不改变版本号与生效日期。 +-- 背景:后台管理端已豁免协议版本校验,协议正文需同步说明后台管理端不适用重新确认流程。 +-- 幂等:REPLACE 的匹配串以句号结尾,替换后原句号变为分号,重复执行不会再次匹配或二次拼接。 +-- 注意:V17/V18/V19/V20 已执行,不得修改;本文件只更新当前生效版本(status = 1)的正文。 + +UPDATE t_legal_agreement +SET content = REPLACE( + content, + '协议发生重要变更时,我们会通过小程序提示并重新征得同意。', + '协议发生重要变更时,我们会通过小程序提示并重新征得同意;后台管理端(运营管理后台)不适用重新确认流程,平台运营人员登录后台即视为已知悉当前版本。' + ), + update_time = NOW() +WHERE agreement_type = 'USER_TERMS' + AND status = 1 + AND is_delete = 0 + AND content LIKE '%协议发生重要变更时,我们会通过小程序提示并重新征得同意。%'; + +UPDATE t_legal_agreement +SET content = REPLACE( + content, + '处理目的、信息类别或第三方范围发生重要变化时,我们会更新版本并通过小程序提示、公告或重新征得同意等方式告知。', + '处理目的、信息类别或第三方范围发生重要变化时,我们会更新版本并通过小程序提示、公告或重新征得同意等方式告知;后台管理端(运营管理后台)不适用重新确认流程。' + ), + update_time = NOW() +WHERE agreement_type = 'PRIVACY_POLICY' + AND status = 1 + AND is_delete = 0 + AND content LIKE '%处理目的、信息类别或第三方范围发生重要变化时,我们会更新版本并通过小程序提示、公告或重新征得同意等方式告知。%'; diff --git a/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptorTest.java b/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptorTest.java index 9149ab16..a0b7c040 100644 --- a/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptorTest.java +++ b/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/config/AgreementAcceptanceInterceptorTest.java @@ -17,6 +17,7 @@ import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) @@ -76,6 +77,33 @@ class AgreementAcceptanceInterceptorTest { assertTrue(interceptor.preHandle(authenticatedRequest(9L), new MockHttpServletResponse(), new Object())); } + @Test + void allowsAdminPathWithoutAgreementCheck() throws Exception { + MockHttpServletRequest request = authenticatedRequest(9L); + request.setRequestURI("/admin/dashboard/overview"); + + assertTrue(interceptor.preHandle(request, new MockHttpServletResponse(), new Object())); + verifyNoInteractions(agreementVersionCacheService); + } + + @Test + void allowsLegacyAdminApiPrefixWithoutAgreementCheck() throws Exception { + MockHttpServletRequest request = authenticatedRequest(9L); + request.setRequestURI("/admin/api/dashboard/overview"); + + assertTrue(interceptor.preHandle(request, new MockHttpServletResponse(), new Object())); + verifyNoInteractions(agreementVersionCacheService); + } + + @Test + void allowsBusinessPrefixedAdminPathWithoutAgreementCheck() throws Exception { + MockHttpServletRequest request = authenticatedRequest(9L); + request.setRequestURI("/order/admin/list"); + + assertTrue(interceptor.preHandle(request, new MockHttpServletResponse(), new Object())); + verifyNoInteractions(agreementVersionCacheService); + } + private MockHttpServletRequest authenticatedRequest(Long userId) { MockHttpServletRequest request = new MockHttpServletRequest(); request.setAttribute("userId", userId); diff --git a/JC-Salon-Frontend/public/legal/privacy-policy.html b/JC-Salon-Frontend/public/legal/privacy-policy.html index 6786b6c2..33b45fae 100644 --- a/JC-Salon-Frontend/public/legal/privacy-policy.html +++ b/JC-Salon-Frontend/public/legal/privacy-policy.html @@ -72,7 +72,7 @@

十、跨境传输

目前我们不涉及向境外提供个人信息。如未来因业务需要发生跨境传输,我们将另行告知处理目的、接收方和联系方式,并依法取得单独同意或完成安全评估、备案等程序。

十一、政策更新与联系

-

处理目的、数据类别或服务商发生重要变化时,我们会更新本政策并在需要时重新征求同意。用户可以在账号设置查看当前版本、注销申请状态、撤回待处理申请并提交隐私相关请求;也可联系所属门店管理员。

+

处理目的、数据类别或服务商发生重要变化时,我们会更新本政策并在需要时重新征求同意;后台管理端(运营管理后台)不适用重新确认流程。用户可以在账号设置查看当前版本、注销申请状态、撤回待处理申请并提交隐私相关请求;也可联系所属门店管理员。

本文件是产品说明,不构成法律意见;上线前应由运营方或专业顾问结合实际处理活动审阅。

diff --git a/JC-Salon-Frontend/public/legal/user-terms.html b/JC-Salon-Frontend/public/legal/user-terms.html index 366c7318..c6ff6c13 100644 --- a/JC-Salon-Frontend/public/legal/user-terms.html +++ b/JC-Salon-Frontend/public/legal/user-terms.html @@ -33,7 +33,7 @@