修复安全配置服务循环依赖
This commit is contained in:
+10
-6
@@ -3,7 +3,6 @@ package com.xiaowang.jayucloud.salon.core.modules.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.xiaowang.jayucloud.salon.core.config.WechatMiniProperties;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.privacy.config.ContentModerationProperties;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.security.support.AdminScopeHelper;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.system.dto.SecureIntegrationConfigDTO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.system.entity.SecureIntegrationConfigDO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.system.entity.SystemParameterConfigDO;
|
||||
@@ -39,14 +38,13 @@ public class SecureIntegrationConfigServiceImpl implements SecureIntegrationConf
|
||||
private final SecureIntegrationConfigMapper secureConfigMapper;
|
||||
private final SystemParameterConfigMapper systemParameterConfigMapper;
|
||||
private final SecureConfigEncryptionService encryptionService;
|
||||
private final AdminScopeHelper adminScopeHelper;
|
||||
private final ContentModerationProperties moderationProperties;
|
||||
private final WechatMiniProperties wechatMiniProperties;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public SecureIntegrationConfigVO getAdminConfig(UserDO currentUser) {
|
||||
adminScopeHelper.requirePlatformAdmin(currentUser, "仅平台管理员可以管理安全接入配置");
|
||||
requirePlatformAdmin(currentUser);
|
||||
migrateLegacyMapConfig();
|
||||
SecureIntegrationConfigVO result = new SecureIntegrationConfigVO();
|
||||
result.setEncryptionKeyConfigured(encryptionService.isConfigured());
|
||||
@@ -89,7 +87,7 @@ public class SecureIntegrationConfigServiceImpl implements SecureIntegrationConf
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveMapConfig(UserDO currentUser, SecureIntegrationConfigDTO dto) {
|
||||
adminScopeHelper.requirePlatformAdmin(currentUser, "仅平台管理员可以管理安全接入配置");
|
||||
requirePlatformAdmin(currentUser);
|
||||
requireEncryptionKey();
|
||||
migrateLegacyMapConfig();
|
||||
|
||||
@@ -117,7 +115,7 @@ public class SecureIntegrationConfigServiceImpl implements SecureIntegrationConf
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveModerationConfig(UserDO currentUser, SecureIntegrationConfigDTO dto) {
|
||||
adminScopeHelper.requirePlatformAdmin(currentUser, "仅平台管理员可以管理安全接入配置");
|
||||
requirePlatformAdmin(currentUser);
|
||||
requireEncryptionKey();
|
||||
|
||||
String provider = normalizedProvider(dto.getModerationProvider());
|
||||
@@ -168,7 +166,7 @@ public class SecureIntegrationConfigServiceImpl implements SecureIntegrationConf
|
||||
@Override
|
||||
@Transactional
|
||||
public Map<String, String> getMapRuntimeConfig(UserDO currentUser) {
|
||||
adminScopeHelper.requirePlatformAdmin(currentUser, "仅平台管理员可以读取地图运行密钥");
|
||||
requirePlatformAdmin(currentUser);
|
||||
migrateLegacyMapConfig();
|
||||
String provider = upper(readValue(MAP, "PROVIDER", "TENCENT"), "TENCENT");
|
||||
boolean enabled = Boolean.parseBoolean(readValue(MAP, "ENABLED", "false"));
|
||||
@@ -322,6 +320,12 @@ public class SecureIntegrationConfigServiceImpl implements SecureIntegrationConf
|
||||
}
|
||||
}
|
||||
|
||||
private void requirePlatformAdmin(UserDO currentUser) {
|
||||
if (currentUser == null || !Integer.valueOf(4).equals(currentUser.getType())) {
|
||||
throw new RuntimeException("仅平台管理员可以管理安全接入配置");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isMockAllowed() {
|
||||
return Boolean.TRUE.equals(moderationProperties.getAllowMock());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# 项目变更记录
|
||||
|
||||
## 2026-10-30 Salon 安全接入配置服务启动循环修复
|
||||
|
||||
- 安全接入配置服务不再依赖 `AdminScopeHelper` / `UserServiceImpl`,改为在服务边界校验调用方必须为平台管理员 `type = 4`,保留配置读取和写入的管理员门禁。
|
||||
- 解除“用户资料审核 → 内容审核 Provider → 安全接入配置 → 管理员作用域 → 用户服务”的 Spring Bean 环;不启用循环依赖兼容开关。
|
||||
- Core 编译通过,安全接入配置服务单测 7 项通过;DEV Core 实际启动成功,Flyway 校验并应用 V11 后 Tomcat 在 8081 正常启动,随后已关闭测试进程。启动期间既有对象存储备份消息因七牛桶不存在产生异步错误,与本次依赖修复无关。
|
||||
- GitNexus 对 `requirePlatformAdmin` 影响分析为 CRITICAL(23 个直接调用点),因此未修改共享管理员校验;仅移除配置服务对该 Helper 的注入。GitNexus `detect_changes` 在提交前完成。
|
||||
|
||||
## 2026-10-30 Salon 注册、预约、客户与设置闭环修复
|
||||
|
||||
- 注册提交结果按服务端实际申请状态和资料审核状态展示;一次性票据失效时提示重新快捷登录获取凭证。
|
||||
|
||||
Reference in New Issue
Block a user