Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
抓蛙师 2021-09-26 16:07:32 +08:00
commit 01d88f4428
2 changed files with 4 additions and 37 deletions

View File

@ -1,32 +0,0 @@
package com.ruoyi.framework.config;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.ServletUtils;
/**
* 服务相关配置
*
* @author ruoyi
*/
@Component
public class ServerConfig
{
/**
* 获取完整的请求路径包括域名端口上下文访问路径
*
* @return 服务地址
*/
public String getUrl()
{
HttpServletRequest request = ServletUtils.getRequest();
return getDomain(request);
}
public static String getDomain(HttpServletRequest request)
{
StringBuffer url = request.getRequestURL();
String contextPath = request.getServletContext().getContextPath();
return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
}
}

View File

@ -39,14 +39,13 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
throws ServletException, IOException
{
// 匿名路径放行 默认拦截
boolean flag = false;
boolean flag = true;
PathMatcher pm = new AntPathMatcher();
for (String anonymou : securityProperties.getAnonymous()) {
PathMatcher pm = new AntPathMatcher();
if (pm.matchStart(anonymou, request.getRequestURI())) {
flag = true;
if (pm.match(anonymou, request.getRequestURI())) {
flag = false;
break;
}
}
if (flag) {
LoginUser loginUser = tokenService.getLoginUser(request);