feat:增加RoleIgnore
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
package com.tiesheng.annotation.role;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
@Target({ElementType.METHOD})
|
||||||
|
@Documented
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface RoleIgnore {
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ 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.role.RoleIgnore;
|
||||||
import com.tiesheng.annotation.token.TokenIgnore;
|
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;
|
||||||
@@ -48,6 +49,10 @@ public class RoleAuthorityAspect {
|
|||||||
if (tokenIgnore != null) {
|
if (tokenIgnore != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
RoleIgnore roleIgnore = signature.getMethod().getAnnotation(RoleIgnore.class);
|
||||||
|
if (roleIgnore != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
HttpServletRequest request = ServletKit.getRequest();
|
HttpServletRequest request = ServletKit.getRequest();
|
||||||
TokenBean tokenBean = tsTokenConfig.validToken(request, true);
|
TokenBean tokenBean = tsTokenConfig.validToken(request, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user