|
|
@@ -22,6 +22,7 @@ import com.uas.kanban.model.User;
|
|
|
import com.uas.kanban.model.User.Role;
|
|
|
import com.uas.kanban.support.SessionHelper;
|
|
|
import com.uas.kanban.support.SystemSession;
|
|
|
+import com.uas.kanban.util.StringUtils;
|
|
|
|
|
|
/**
|
|
|
* 安全验证
|
|
|
@@ -68,8 +69,12 @@ public class SecurityInterceptor extends HandlerInterceptorAdapter {
|
|
|
// session 中不存在登陆信息
|
|
|
if (user == null) {
|
|
|
logger.info("No session for path: " + url + " , redirecting to page: login ...");
|
|
|
- response.sendRedirect(
|
|
|
- contextPath + "/login?returnUrl=" + URLEncoder.encode(request.getRequestURL().toString(), "UTF-8"));
|
|
|
+ String returnUrl = request.getRequestURL().toString();
|
|
|
+ String queryString = request.getQueryString();
|
|
|
+ if (!StringUtils.isEmpty(queryString)) {
|
|
|
+ returnUrl += "?" + queryString;
|
|
|
+ }
|
|
|
+ response.sendRedirect(contextPath + "/login?returnUrl=" + URLEncoder.encode(returnUrl, "UTF-8"));
|
|
|
return false;
|
|
|
}
|
|
|
|