Compare commits

..

4 Commits

Author SHA1 Message Date
曾文豪
6949f50c7c publish 2.0.0.rc37 2024-08-22 17:13:29 +08:00
曾文豪
7b43ae3ce1 publish 2.0.0.rc36 2024-08-22 17:09:14 +08:00
曾文豪
8ca283ca85 perf:登录的时候清除授权信息,相当于刷新一下权限 2024-08-22 09:46:04 +08:00
曾文豪
3728291e73 publish 2.0.0.rc35 2024-08-19 19:15:56 +08:00
14 changed files with 35 additions and 24 deletions

22
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>springboot-parent</name> <name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description> <description>杭州铁晟科技有限公司基础依赖</description>
@@ -58,61 +58,61 @@
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-role</artifactId> <artifactId>springboot-role</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -6,11 +6,11 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-ademo</artifactId> <artifactId>springboot-ademo</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>

View File

@@ -11,7 +11,9 @@ import com.tiesheng.login.pojos.dao.CorePlatformUnique;
import com.tiesheng.util.ServletKit; import com.tiesheng.util.ServletKit;
import com.tiesheng.util.config.Ip2regionConfig; import com.tiesheng.util.config.Ip2regionConfig;
import com.tiesheng.util.pojos.TokenBean; import com.tiesheng.util.pojos.TokenBean;
import com.tiesheng.util.service.TsCacheService;
import com.tiesheng.util.service.TsServiceBase; import com.tiesheng.util.service.TsServiceBase;
import com.tiesheng.util.service.role.TsAuthorityHandler;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -51,6 +53,10 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
TokenBean tokenBean = tsLoginConfigurer.login(platformUnique); TokenBean tokenBean = tsLoginConfigurer.login(platformUnique);
if (tokenBean != null) { if (tokenBean != null) {
// 清除授权信息
TsCacheService.of().remove(StrUtil.format(TsAuthorityHandler.CACHE_HAS_AUTHORITY,
tokenBean.getRoleId(), tokenBean.getId()));
// 添加登录日志 // 添加登录日志
addLoginLog(platformUnique, tokenBean); addLoginLog(platformUnique, tokenBean);
@@ -61,7 +67,6 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
saveOrUpdate(platformUnique); saveOrUpdate(platformUnique);
} }
} }
return tokenBean; return tokenBean;

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-role</artifactId> <artifactId>springboot-role</artifactId>

View File

@@ -18,11 +18,13 @@ import com.tiesheng.role.pojos.dao.CoreRoleUser;
import com.tiesheng.role.pojos.dto.GroupRxUpdateDTO; import com.tiesheng.role.pojos.dto.GroupRxUpdateDTO;
import com.tiesheng.role.pojos.dto.OwnerMenuDTO; import com.tiesheng.role.pojos.dto.OwnerMenuDTO;
import com.tiesheng.role.pojos.vo.ServiceMenuVO; import com.tiesheng.role.pojos.vo.ServiceMenuVO;
import com.tiesheng.util.config.GlobalConfig;
import com.tiesheng.util.exception.ApiException; import com.tiesheng.util.exception.ApiException;
import com.tiesheng.util.service.TsCacheService; import com.tiesheng.util.service.TsCacheService;
import com.tiesheng.util.service.TsServiceBase; import com.tiesheng.util.service.TsServiceBase;
import com.tiesheng.util.service.role.TsAuthorityHandler; import com.tiesheng.util.service.role.TsAuthorityHandler;
import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.ContextRefreshedEvent;
@@ -48,6 +50,8 @@ public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRole
CoreRoleServerMapper coreRoleServerMapper; CoreRoleServerMapper coreRoleServerMapper;
@Resource @Resource
TsAuthorityHandler tsAuthorityHandler; TsAuthorityHandler tsAuthorityHandler;
@Autowired
private GlobalConfig globalConfig;
public CoreRoleServerMapper getServerMapper() { public CoreRoleServerMapper getServerMapper() {
return coreRoleServerMapper; return coreRoleServerMapper;
@@ -241,6 +245,7 @@ public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRole
return menuChildrenWrap(ownerAuthorityList.stream() return menuChildrenWrap(ownerAuthorityList.stream()
.filter(it -> Objects.equals(it.getType(), "group") || Objects.equals(it.getType(), "menu")) .filter(it -> Objects.equals(it.getType(), "group") || Objects.equals(it.getType(), "menu"))
.filter(it -> Objects.equals(it.getService(), dto.getService()) && Objects.equals(it.getPlatform(), dto.getPlatform()))
.collect(Collectors.toList()), null) .collect(Collectors.toList()), null)
.stream().sorted(Comparator.comparingInt(ServiceMenuVO::getSort)) .stream().sorted(Comparator.comparingInt(ServiceMenuVO::getSort))
.map(ServiceMenuVO::sortChildren) .map(ServiceMenuVO::sortChildren)
@@ -274,6 +279,7 @@ public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRole
coreRoleAuthorityMapper.delete(new QueryWrapper<CoreRoleAuthority>() coreRoleAuthorityMapper.delete(new QueryWrapper<CoreRoleAuthority>()
.ne("version", version) .ne("version", version)
.eq("service", globalConfig.getService())
.eq("source", "auto") .eq("source", "auto")
); );

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>2.0.0.rc34</version> <version>2.0.0.rc37</version>
</parent> </parent>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>