publish 2.0.0.rc18
This commit is contained in:
22
pom.xml
22
pom.xml
@@ -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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-ademo</artifactId>
|
<artifactId>springboot-ademo</artifactId>
|
||||||
<version>2.0.0.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-annotation</artifactId>
|
<artifactId>springboot-annotation</artifactId>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-database</artifactId>
|
<artifactId>springboot-database</artifactId>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-encrypt</artifactId>
|
<artifactId>springboot-encrypt</artifactId>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-login</artifactId>
|
<artifactId>springboot-login</artifactId>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-message</artifactId>
|
<artifactId>springboot-message</artifactId>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-platform</artifactId>
|
<artifactId>springboot-platform</artifactId>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-poi</artifactId>
|
<artifactId>springboot-poi</artifactId>
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-role</artifactId>
|
<artifactId>springboot-role</artifactId>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import cn.hutool.core.lang.Validator;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.tiesheng.annotation.role.RoleAuthority;
|
import com.tiesheng.annotation.role.RoleAuthority;
|
||||||
import com.tiesheng.role.config.RoleAuthorityAspect;
|
|
||||||
import com.tiesheng.role.mapper.*;
|
import com.tiesheng.role.mapper.*;
|
||||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||||
import com.tiesheng.role.pojos.dao.CoreRoleGroup;
|
import com.tiesheng.role.pojos.dao.CoreRoleGroup;
|
||||||
@@ -162,7 +161,7 @@ public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRole
|
|||||||
* 当授权发生变化时
|
* 当授权发生变化时
|
||||||
*/
|
*/
|
||||||
public void onRoleChange(String roleId, String userId) {
|
public void onRoleChange(String roleId, String userId) {
|
||||||
TsCacheService.of().keys(StrUtil.format(RoleAuthorityAspect.CACHE_HAS_AUTHORITY,
|
TsCacheService.of().keys(StrUtil.format(TsAuthorityHandler.CACHE_HAS_AUTHORITY,
|
||||||
roleId, userId)).forEach(key -> TsCacheService.of().remove(key));
|
roleId, userId)).forEach(key -> TsCacheService.of().remove(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-util</artifactId>
|
<artifactId>springboot-util</artifactId>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public interface TsAuthorityHandler {
|
public interface TsAuthorityHandler {
|
||||||
|
|
||||||
|
String CACHE_HAS_AUTHORITY = "CACHE:HAS_AUTHORITY:{}:{}";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加所有的权限
|
* 添加所有的权限
|
||||||
|
|||||||
@@ -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.rc17</version>
|
<version>2.0.0.rc18</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-web</artifactId>
|
<artifactId>springboot-web</artifactId>
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.tiesheng.role.config;
|
package com.tiesheng.web.config.role;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.tiesheng.annotation.role.RoleAuthority;
|
import com.tiesheng.annotation.role.RoleAuthority;
|
||||||
|
import com.tiesheng.annotation.token.TokenIgnore;
|
||||||
import com.tiesheng.util.ServletKit;
|
import com.tiesheng.util.ServletKit;
|
||||||
import com.tiesheng.util.config.TsTokenConfig;
|
import com.tiesheng.util.config.TsTokenConfig;
|
||||||
import com.tiesheng.util.exception.ApiException;
|
import com.tiesheng.util.exception.ApiException;
|
||||||
@@ -24,8 +25,6 @@ import java.util.stream.Collectors;
|
|||||||
@Component
|
@Component
|
||||||
public class RoleAuthorityAspect {
|
public class RoleAuthorityAspect {
|
||||||
|
|
||||||
public static final String CACHE_HAS_AUTHORITY = "CACHE:HAS_AUTHORITY:{}:{}";
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
TsTokenConfig tsTokenConfig;
|
TsTokenConfig tsTokenConfig;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -43,9 +42,16 @@ public class RoleAuthorityAspect {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 忽略TOKEN时不校验
|
||||||
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
|
TokenIgnore tokenIgnore = signature.getMethod().getAnnotation(TokenIgnore.class);
|
||||||
|
if (tokenIgnore != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
HttpServletRequest request = ServletKit.getRequest();
|
HttpServletRequest request = ServletKit.getRequest();
|
||||||
TokenBean tokenBean = tsTokenConfig.validToken(request, true);
|
TokenBean tokenBean = tsTokenConfig.validToken(request, true);
|
||||||
String cacheKey = StrUtil.format(CACHE_HAS_AUTHORITY, tokenBean.getRoleId(), tokenBean.getId());
|
String cacheKey = StrUtil.format(TsAuthorityHandler.CACHE_HAS_AUTHORITY, tokenBean.getRoleId(), tokenBean.getId());
|
||||||
List<String> authorityList = StrUtil.split(TsCacheService.of().get(cacheKey), ";")
|
List<String> authorityList = StrUtil.split(TsCacheService.of().get(cacheKey), ";")
|
||||||
.stream().filter(StrUtil::isNotEmpty).collect(Collectors.toList());
|
.stream().filter(StrUtil::isNotEmpty).collect(Collectors.toList());
|
||||||
if (CollUtil.isEmpty(authorityList)) {
|
if (CollUtil.isEmpty(authorityList)) {
|
||||||
@@ -56,7 +62,6 @@ public class RoleAuthorityAspect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String authority = StrUtil.join("_", classAnnotation.group(), classAnnotation.value());
|
String authority = StrUtil.join("_", classAnnotation.group(), classAnnotation.value());
|
||||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
|
||||||
RoleAuthority annotation = signature.getMethod().getAnnotation(RoleAuthority.class);
|
RoleAuthority annotation = signature.getMethod().getAnnotation(RoleAuthority.class);
|
||||||
if (annotation != null) {
|
if (annotation != null) {
|
||||||
// 检查是否是功能点的权限
|
// 检查是否是功能点的权限
|
||||||
Reference in New Issue
Block a user