Commit 9f98a5a0 authored by daniel's avatar daniel

fix(interceptor): 拦截器优化

parent fe879a1c
...@@ -75,12 +75,6 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor ...@@ -75,12 +75,6 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor
return true; return true;
} }
// /gk/ 和 /easy/ 路径要求session登录
if ((uri.startsWith("/gk/") || uri.contains("easy")) && request.getSession().getAttribute("user") == null) {
response.sendRedirect(domain + "auth_no");
return false;
}
// 小程序请求放行(小程序没有session) // 小程序请求放行(小程序没有session)
String userAgent = request.getHeader("user-agent"); String userAgent = request.getHeader("user-agent");
if (userAgent != null) { if (userAgent != null) {
...@@ -90,6 +84,14 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor ...@@ -90,6 +84,14 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor
} }
} }
// /gk/ 和 /easy/ 路径要求session登录
if ((uri.startsWith("/gk/") || uri.contains("easy")) && request.getSession().getAttribute("user") == null) {
response.sendRedirect(domain + "auth_no");
return false;
}
if (annotation != null) { if (annotation != null) {
// 已登录的用户跳过sign校验 // 已登录的用户跳过sign校验
if (request.getSession().getAttribute("user") != null) { if (request.getSession().getAttribute("user") != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment