Gexy

Results 3 comments of Gexy

https://github.com/Smith-Cruise/Spring-Boot-Shiro/blob/master/src/main/java/org/inlighting/shiro/JWTFilter.java 如果没有携带Token, isLoginAttempt会一直返回true,isAccessAllowed也会返回true,即不会执行executeLogin方法,不会执行Relam方法。此时如果没有携带TOKEN,访问到敏感资源 代码如下: ```java protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { if (isLoginAttempt(request, response)) { try { executeLogin(request, response); } catch (Exception e) { response401(request, response); }...

> @GeXyu 哥们 有解决方案了吗 在url如果配置了该过滤器 ,说明是需要进行Token校验的,所以必须携带token,如果没有携带则认为无效请求,如果想匿名访问,则配置anno过滤器 代码配置如下: ```xml //必须登录且具有admin角色 filterRuleMap.put("/**", "jwt,roles[admin]"); //必须登录 filterRuleMap.put("/**", "jwt"); //匿名访问 filterRuleMap.put("/login", "anon"); ```