mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-11 06:57:12 +08:00
fix: 修复租户套餐更新时租户权限未更新问题、租户操作日志未记录问题、租户角色管理模块菜单过滤、删除租户时菜单被删除问题
This commit is contained in:
@@ -20,6 +20,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import top.continew.admin.system.mapper.LogMapper;
|
||||
import top.continew.admin.system.service.UserService;
|
||||
import top.continew.starter.extension.tenant.autoconfigure.TenantProperties;
|
||||
import top.continew.starter.log.annotation.ConditionalOnEnabledLog;
|
||||
import top.continew.starter.log.dao.LogDao;
|
||||
import top.continew.starter.trace.autoconfigure.TraceProperties;
|
||||
@@ -38,7 +39,10 @@ public class LogConfiguration {
|
||||
* 日志持久层接口本地实现类
|
||||
*/
|
||||
@Bean
|
||||
public LogDao logDao(UserService userService, LogMapper logMapper, TraceProperties traceProperties) {
|
||||
return new LogDaoLocalImpl(userService, logMapper, traceProperties);
|
||||
public LogDao logDao(UserService userService,
|
||||
LogMapper logMapper,
|
||||
TraceProperties traceProperties,
|
||||
TenantProperties tenantProperties) {
|
||||
return new LogDaoLocalImpl(userService, logMapper, traceProperties, tenantProperties);
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ import top.continew.admin.system.service.UserService;
|
||||
import top.continew.starter.core.constant.StringConstants;
|
||||
import top.continew.starter.core.util.ExceptionUtils;
|
||||
import top.continew.starter.core.util.StrUtils;
|
||||
import top.continew.starter.extension.tenant.context.TenantContextHolder;
|
||||
import top.continew.starter.extension.tenant.autoconfigure.TenantProperties;
|
||||
import top.continew.starter.extension.tenant.util.TenantUtils;
|
||||
import top.continew.starter.log.dao.LogDao;
|
||||
import top.continew.starter.log.model.LogRecord;
|
||||
@@ -67,6 +67,7 @@ public class LogDaoLocalImpl implements LogDao {
|
||||
private final UserService userService;
|
||||
private final LogMapper logMapper;
|
||||
private final TraceProperties traceProperties;
|
||||
private final TenantProperties tenantProperties;
|
||||
|
||||
@Async
|
||||
@Override
|
||||
@@ -87,8 +88,12 @@ public class LogDaoLocalImpl implements LogDao {
|
||||
logDO.setCreateTime(LocalDateTime.ofInstant(logRecord.getTimestamp(), ZoneId.systemDefault()));
|
||||
// 设置操作人
|
||||
this.setCreateUser(logDO, logRequest, logResponse);
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
TenantUtils.execute(tenantId, () -> logMapper.insert(logDO));
|
||||
String strTenantId = logRequest.getHeaders().get(tenantProperties.getTenantIdHeader());
|
||||
if (StrUtil.isNotBlank(strTenantId)) {
|
||||
TenantUtils.execute(Long.parseLong(strTenantId), () -> logMapper.insert(logDO));
|
||||
} else {
|
||||
logMapper.insert(logDO);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -223,7 +223,7 @@ continew-starter.tenant:
|
||||
- sys_sms_log # 短信日志表
|
||||
- sys_client # 客户端表
|
||||
- sys_app # 应用表
|
||||
- sys_menu
|
||||
- sys_menu # 菜单表
|
||||
# 忽略菜单 ID(租户不能使用的菜单)
|
||||
ignore-menus:
|
||||
- 1130 # 字典管理
|
||||
@@ -234,6 +234,7 @@ continew-starter.tenant:
|
||||
- 7000 # 能力开放
|
||||
- 8000 # 任务调度
|
||||
- 9000 # 开发工具
|
||||
- 1050 # 菜单管理
|
||||
|
||||
--- ### 限流器配置
|
||||
continew-starter:
|
||||
|
Reference in New Issue
Block a user