|
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
+import java.net.URL;
|
|
|
+import java.net.URLDecoder;
|
|
|
|
|
|
/**
|
|
|
* @Author: xuexb
|
|
@@ -60,10 +62,10 @@ public class PageController extends BaseController{
|
|
|
// return "redirect:"+afterLogin;
|
|
|
// }
|
|
|
// return "login";
|
|
|
-
|
|
|
+ LOG.info("redirect:" + redirect);
|
|
|
String redirectUrl = "";
|
|
|
try {
|
|
|
- redirectUrl = EncryptionUtil.decryptDES(redirect);
|
|
|
+ redirectUrl = URLDecoder.decode(redirect, "UTF-8");
|
|
|
} catch (Exception e) {
|
|
|
LOG.error("redirectUrl 解码出错", e);
|
|
|
redirectUrl = null;
|
|
@@ -72,7 +74,7 @@ public class PageController extends BaseController{
|
|
|
redirectUrl = UrlConstants.DFAULT_GOTO;
|
|
|
}
|
|
|
HttpSession session = request.getSession();
|
|
|
- session.setAttribute("RedirectUrl", redirectUrl);
|
|
|
+ session.setAttribute("redirectURL", redirectUrl);
|
|
|
LOG.info("RedirectUrl" + redirectUrl);
|
|
|
if (session.getAttribute("userId") != null){
|
|
|
LOG.info("用户已登录!用户ID"+session.getAttribute("userId").toString());
|
|
@@ -90,6 +92,7 @@ public class PageController extends BaseController{
|
|
|
if (result.getStatus() == ResponseStatus.SUCCESS) {
|
|
|
HttpSession session = request.getSession();
|
|
|
session.setAttribute("userId", ((UserDTO)result.getData()).getId());
|
|
|
+ session.setAttribute("userName", ((UserDTO)result.getData()).getEmail());
|
|
|
// return "redirect:http://www.mooctest.net/api/test/login";
|
|
|
String afterLogin = session.getAttribute("redirectURL")==null?
|
|
|
UrlConstants.DFAULT_GOTO:(String)session.getAttribute("redirectURL");
|