|
@@ -5,6 +5,7 @@ import com.bizmatics.common.core.exception.BusinessException;
|
|
import com.bizmatics.model.User;
|
|
import com.bizmatics.model.User;
|
|
import com.bizmatics.service.util.SessionLocal;
|
|
import com.bizmatics.service.util.SessionLocal;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.elasticsearch.rest.RestRequest;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.servlet.*;
|
|
import javax.servlet.*;
|
|
@@ -46,9 +47,9 @@ public class SessionFilter implements Filter {
|
|
// httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
|
|
// httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
|
|
// // 允许浏览器发送的请求消息头
|
|
// // 允许浏览器发送的请求消息头
|
|
// httpServletResponse.setHeader("Access-Control-Allow-Headers", "Authorization,Origin, X-Requested-With, Content-Type, Accept,Access-Token");
|
|
// httpServletResponse.setHeader("Access-Control-Allow-Headers", "Authorization,Origin, X-Requested-With, Content-Type, Accept,Access-Token");
|
|
-// if(request.getMethod().toUpperCase().equals(RestRequest.Method.OPTIONS.name())){
|
|
|
|
-// return;
|
|
|
|
-// }
|
|
|
|
|
|
+ if(request.getMethod().toUpperCase().equals(RestRequest.Method.OPTIONS.name())){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
String path = request.getRequestURI().substring(request.getContextPath().length()).replaceAll("[/]+$", "");
|
|
String path = request.getRequestURI().substring(request.getContextPath().length()).replaceAll("[/]+$", "");
|
|
boolean allowedPath = ALLOWED_PATHS.contains(path);
|
|
boolean allowedPath = ALLOWED_PATHS.contains(path);
|