fix(salon): 后台管理端豁免协议版本校验并移除后台同意弹层
自动发布开发环境 Nacos 配置 / publish (push) Successful in 19s

This commit is contained in:
2026-11-05 16:32:55 +08:00
parent 385c4b06ec
commit 3a91246e0c
4 changed files with 54 additions and 74 deletions
@@ -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<String, String> currentVersions,
List<String> pendingTypes) throws Exception {