Shiro filter to solve the problem caused swagger-ui.html request access to less than?

Recent projects using separate front and back of the development model, the frame is springboot1.5.9 + shiro + vue

Since Swagger2 request address http: // localhost: 8090 / swagger -ui.html , however shiro when configuring the filter, the filter will request again, resulting in http: // localhost: 8090 / swagger -ui.html request can not be authenticated, the request failed.

Solution: Add in shiro's profile configuration look

filterChainDefinitionMap.put("/swagger-ui.html", "anon");
filterChainDefinitionMap.put("/swagger-resources", "anon");
filterChainDefinitionMap.put("/swagger-resources/configuration/security", "anon");
filterChainDefinitionMap.put("/swagger-resources/configuration/ui", "anon");
filterChainDefinitionMap.put("/v2/api-docs", "anon");
filterChainDefinitionMap.put("/webjars/springfox-swagger-ui/**", "anon");

Guess you like

Origin blog.csdn.net/it_erge/article/details/91980894