|
@@ -71,7 +71,10 @@ public class PageController extends BaseController{
|
|
redirectUrl = null;
|
|
redirectUrl = null;
|
|
}
|
|
}
|
|
if (redirectUrl==null || redirectUrl.isEmpty() || !redirectUrl.startsWith("http")){
|
|
if (redirectUrl==null || redirectUrl.isEmpty() || !redirectUrl.startsWith("http")){
|
|
- redirectUrl = UrlConstants.DFAULT_GOTO;
|
|
|
|
|
|
+ if (request.getSession().getAttribute("redirectURL")==null)
|
|
|
|
+ redirectUrl = UrlConstants.DFAULT_GOTO;
|
|
|
|
+ else
|
|
|
|
+ redirectUrl = (String) request.getSession().getAttribute(("redirectURL"));
|
|
}
|
|
}
|
|
HttpSession session = request.getSession();
|
|
HttpSession session = request.getSession();
|
|
session.setAttribute("redirectURL", redirectUrl);
|
|
session.setAttribute("redirectURL", redirectUrl);
|
|
@@ -96,6 +99,7 @@ public class PageController extends BaseController{
|
|
// return "redirect:http://www.mooctest.net/api/test/login";
|
|
// return "redirect:http://www.mooctest.net/api/test/login";
|
|
String afterLogin = session.getAttribute("redirectURL")==null?
|
|
String afterLogin = session.getAttribute("redirectURL")==null?
|
|
UrlConstants.DFAULT_GOTO:(String)session.getAttribute("redirectURL");
|
|
UrlConstants.DFAULT_GOTO:(String)session.getAttribute("redirectURL");
|
|
|
|
+ LOG.info("redirectURL: "+afterLogin);
|
|
return "redirect:" + afterLogin;
|
|
return "redirect:" + afterLogin;
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
@@ -116,7 +120,9 @@ public class PageController extends BaseController{
|
|
if (result.getStatus() != ResponseStatus.SUCCESS){
|
|
if (result.getStatus() != ResponseStatus.SUCCESS){
|
|
return "mobile_login";
|
|
return "mobile_login";
|
|
}
|
|
}
|
|
- request.getSession().setAttribute("userId", ((UserDTO)result.getData()).getId());
|
|
|
|
|
|
+ HttpSession session = request.getSession();
|
|
|
|
+ session.setAttribute("userId", ((UserDTO)result.getData()).getId());
|
|
|
|
+ session.setAttribute("userName", ((UserDTO)result.getData()).getEmail());
|
|
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.DFAULT_GOTO:redirectURL;
|
|
return "redirect:"+redirectURL;
|
|
return "redirect:"+redirectURL;
|
|
@@ -151,7 +157,9 @@ public class PageController extends BaseController{
|
|
model.addAttribute("from", "github");
|
|
model.addAttribute("from", "github");
|
|
return "third_party_bind";
|
|
return "third_party_bind";
|
|
}
|
|
}
|
|
- request.getSession().setAttribute("userId", ((UserThirdParty)result.getData()).getUserId());
|
|
|
|
|
|
+ HttpSession session = request.getSession();
|
|
|
|
+ session.setAttribute("userId", ((UserDTO)result.getData()).getId());
|
|
|
|
+ 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.DFAULT_GOTO;
|
|
@@ -180,7 +188,9 @@ public class PageController extends BaseController{
|
|
userThirdParty.setIsDelete(0);
|
|
userThirdParty.setIsDelete(0);
|
|
System.out.println(userThirdParty.getUserId()+"--"+userThirdParty.getThirdPartyIdentity()+"---"+userThirdParty.getType());
|
|
System.out.println(userThirdParty.getUserId()+"--"+userThirdParty.getThirdPartyIdentity()+"---"+userThirdParty.getType());
|
|
thirdPartyAuthService.save(userThirdParty);
|
|
thirdPartyAuthService.save(userThirdParty);
|
|
- request.getSession().setAttribute("userId", userThirdParty.getUserId());
|
|
|
|
|
|
+ HttpSession session = request.getSession();
|
|
|
|
+ session.setAttribute("userId", ((UserDTO)result.getData()).getId());
|
|
|
|
+ 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.DFAULT_GOTO;
|