mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-23 05:00:25 +08:00
fix:添加loadbalancer依赖解决资源访问无权限问题
This commit is contained in:
parent
aa0540da35
commit
0b14992d38
@ -90,7 +90,7 @@ public interface AuthConstants {
|
||||
/**
|
||||
* 后台管理接口路径匹配
|
||||
*/
|
||||
String ADMIN_URL_PATTERN = "/api.admin/**";
|
||||
String ADMIN_URL_PATTERN = "**/api.admin/**";
|
||||
|
||||
|
||||
String LOGOUT_PATH = "/youlai-auth/oauth/logout";
|
||||
|
@ -39,7 +39,7 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
|
||||
ServerHttpRequest request = authorizationContext.getExchange().getRequest();
|
||||
// Restful接口权限设计 @link https://www.cnblogs.com/haoxianrui/p/14396990.html
|
||||
String restPath = request.getMethodValue() + "_" + request.getURI().getPath();
|
||||
log.info("请求路径={}", restPath);
|
||||
log.info("请求路径:{}", restPath);
|
||||
PathMatcher pathMatcher = new AntPathMatcher();
|
||||
// 对应跨域的预检请求直接放行
|
||||
if (request.getMethod() == HttpMethod.OPTIONS) {
|
||||
@ -48,7 +48,7 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
|
||||
|
||||
// 非管理端路径无需鉴权直接放行
|
||||
if (!pathMatcher.match(AuthConstants.ADMIN_URL_PATTERN, restPath)) {
|
||||
log.info("请求无需鉴权,请求路径={}", restPath);
|
||||
log.info("请求无需鉴权,请求路径:{}", restPath);
|
||||
return Mono.just(new AuthorizationDecision(true));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user