|
@@ -57,7 +57,7 @@ public class PageController extends BaseController{
|
|
}
|
|
}
|
|
if (redirectUrl==null || redirectUrl.isEmpty() || !redirectUrl.startsWith("http")){
|
|
if (redirectUrl==null || redirectUrl.isEmpty() || !redirectUrl.startsWith("http")){
|
|
if (request.getSession().getAttribute("redirectURL")==null)
|
|
if (request.getSession().getAttribute("redirectURL")==null)
|
|
- redirectUrl = UrlConstants.DFAULT_GOTO;
|
|
|
|
|
|
+ redirectUrl = UrlConstants.DEFAULT_GOTO;
|
|
else
|
|
else
|
|
redirectUrl = (String) request.getSession().getAttribute(("redirectURL"));
|
|
redirectUrl = (String) request.getSession().getAttribute(("redirectURL"));
|
|
}
|
|
}
|
|
@@ -84,7 +84,7 @@ public class PageController extends BaseController{
|
|
// return "redirect:http://www.mooctest.net/api/test/login";
|
|
// return "redirect:http://www.mooctest.net/api/test/login";
|
|
LOG.info((String)session.getAttribute("redirectURL"));
|
|
LOG.info((String)session.getAttribute("redirectURL"));
|
|
String afterLogin = session.getAttribute("redirectURL")==null?
|
|
String afterLogin = session.getAttribute("redirectURL")==null?
|
|
- UrlConstants.DFAULT_GOTO:(String)session.getAttribute("redirectURL");
|
|
|
|
|
|
+ UrlConstants.DEFAULT_GOTO:(String)session.getAttribute("redirectURL");
|
|
userLogic.recordLoginAction(request, ((UserDTO)result.getData()).getId() , "password");
|
|
userLogic.recordLoginAction(request, ((UserDTO)result.getData()).getId() , "password");
|
|
LOG.info("redirectURL: "+afterLogin);
|
|
LOG.info("redirectURL: "+afterLogin);
|
|
return "redirect:" + afterLogin;
|
|
return "redirect:" + afterLogin;
|
|
@@ -112,7 +112,7 @@ public class PageController extends BaseController{
|
|
session.setAttribute("userName", ((UserDTO)result.getData()).getEmail());
|
|
session.setAttribute("userName", ((UserDTO)result.getData()).getEmail());
|
|
userLogic.recordLoginAction(request, ((UserDTO)result.getData()).getId(), "mobile");
|
|
userLogic.recordLoginAction(request, ((UserDTO)result.getData()).getId(), "mobile");
|
|
String redirectURL = (String) request.getSession().getAttribute("redirectURL");
|
|
String redirectURL = (String) request.getSession().getAttribute("redirectURL");
|
|
- redirectURL = redirectURL==null?UrlConstants.DFAULT_GOTO:redirectURL;
|
|
|
|
|
|
+ redirectURL = redirectURL==null?UrlConstants.DEFAULT_GOTO:redirectURL;
|
|
return "redirect:"+redirectURL;
|
|
return "redirect:"+redirectURL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -153,7 +153,7 @@ public class PageController extends BaseController{
|
|
userLogic.recordLoginAction(request, user.getId(), "github");
|
|
userLogic.recordLoginAction(request, user.getId(), "github");
|
|
String redirectUrl = (String)request.getSession().getAttribute("redirectURL");
|
|
String redirectUrl = (String)request.getSession().getAttribute("redirectURL");
|
|
if (redirectUrl==null || redirectUrl.isEmpty())
|
|
if (redirectUrl==null || redirectUrl.isEmpty())
|
|
- redirectUrl = UrlConstants.DFAULT_GOTO;
|
|
|
|
|
|
+ redirectUrl = UrlConstants.DEFAULT_GOTO;
|
|
return "redirect:"+redirectUrl;
|
|
return "redirect:"+redirectUrl;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -175,7 +175,7 @@ public class PageController extends BaseController{
|
|
userLogic.recordLoginAction(request,userWechatDTO.getUser().getId(), "wechat");
|
|
userLogic.recordLoginAction(request,userWechatDTO.getUser().getId(), "wechat");
|
|
String redirectUrl = (String) session.getAttribute("redirectURL");
|
|
String redirectUrl = (String) session.getAttribute("redirectURL");
|
|
if (redirectUrl==null || redirectUrl.isEmpty())
|
|
if (redirectUrl==null || redirectUrl.isEmpty())
|
|
- redirectUrl = UrlConstants.DFAULT_GOTO;
|
|
|
|
|
|
+ redirectUrl = UrlConstants.DEFAULT_GOTO;
|
|
return "redirect:"+redirectUrl;
|
|
return "redirect:"+redirectUrl;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -224,7 +224,7 @@ public class PageController extends BaseController{
|
|
session.setAttribute("userName", ((UserDTO)result.getData()).getEmail());
|
|
session.setAttribute("userName", ((UserDTO)result.getData()).getEmail());
|
|
String redirectUrl = (String)request.getSession().getAttribute("redirectURL");
|
|
String redirectUrl = (String)request.getSession().getAttribute("redirectURL");
|
|
if (redirectUrl==null || redirectUrl.isEmpty())
|
|
if (redirectUrl==null || redirectUrl.isEmpty())
|
|
- redirectUrl = UrlConstants.DFAULT_GOTO;
|
|
|
|
|
|
+ redirectUrl = UrlConstants.DEFAULT_GOTO;
|
|
return "redirect:"+redirectUrl;
|
|
return "redirect:"+redirectUrl;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -236,13 +236,13 @@ public class PageController extends BaseController{
|
|
}
|
|
}
|
|
if (redirect==null){
|
|
if (redirect==null){
|
|
redirect = request.getSession().getAttribute("redirectURL")==null ?
|
|
redirect = request.getSession().getAttribute("redirectURL")==null ?
|
|
- UrlConstants.DFAULT_GOTO : (String) request.getSession().getAttribute("redirectURL");
|
|
|
|
|
|
+ UrlConstants.DEFAULT_GOTO : (String) request.getSession().getAttribute("redirectURL");
|
|
} else{
|
|
} else{
|
|
try {
|
|
try {
|
|
redirect = URLDecoder.decode(redirect, "UTF-8");
|
|
redirect = URLDecoder.decode(redirect, "UTF-8");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
LOG.error("redirectUrl 解码出错", e);
|
|
LOG.error("redirectUrl 解码出错", e);
|
|
- redirect = UrlConstants.DFAULT_GOTO;
|
|
|
|
|
|
+ redirect = UrlConstants.DEFAULT_GOTO;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
request.getSession().setAttribute("redirectURL", redirect);
|
|
request.getSession().setAttribute("redirectURL", redirect);
|