Skip to content

Commit

Permalink
优化 IamAutoConfig.java写法;
Browse files Browse the repository at this point in the history
  • Loading branch information
ZZemptypoint committed Mar 25, 2022
1 parent b01c508 commit 581cb65
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
*
* @author : uu
* @version : v2.0
* @Date 2019-10-11 10:54
* @date 2019-10-11 10:54
*/
@SuppressWarnings("JavaDoc")
@Slf4j
@Order(922)
@Configuration
Expand Down Expand Up @@ -169,18 +170,14 @@ protected ShiroFilterChainDefinition shiroFilterChainDefinition() {
filterChainMap.put("/auth/2step-code", "anon");
filterChainMap.put("/uploadFile/download/*/image", "anon");

boolean allAnon = false;
Set<String> anonUrls = iamProperties.getAnonUrls();
if (V.notEmpty(anonUrls)) {
for (String url : anonUrls) {
filterChainMap.put(url, "anon");
if (url.equals("/**")) {
allAnon = true;
}
}
}
filterChainMap.put("/login", "authc");
if (allAnon && !iamProperties.isEnablePermissionCheck()) {
if (anonUrls.contains("/**") && !iamProperties.isEnablePermissionCheck()) {
filterChainMap.put("/**", "anon");
} else {
filterChainMap.put("/**", "jwt");
Expand All @@ -195,7 +192,7 @@ protected ShiroFilterChainDefinition shiroFilterChainDefinition() {
*
* @author : uu
* @version : v1.0
* @Date 2020/11/19 11:06
* @date 2020/11/19 11:06
*/
static class StatelessDefaultSubjectFactory extends DefaultWebSubjectFactory {

Expand Down

0 comments on commit 581cb65

Please sign in to comment.