提交修改

This commit is contained in:
quyixiao 2020-11-05 10:38:57 +08:00
parent 65fb40f651
commit 0178bcde83

View File

@ -58,7 +58,10 @@ public class OAuth2Filter extends AuthenticatingFilter {
//获取请求token如果token不存在直接返回401
String token = getRequestToken((HttpServletRequest) request);
String profile = SpringContextUtils.getActiveProfile();
if("prod".equals(profile) && StringUtils.isBlank(token)){
if(!"prod".equals(profile) ){
return true;
}
if(StringUtils.isBlank(token)){
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin());