Commit a8c69dbb authored by 李良停's avatar 李良停

llt

parent fcb9c5a7
...@@ -59,6 +59,7 @@ public class AuthController { ...@@ -59,6 +59,7 @@ public class AuthController {
try { try {
String clientId = request.getParameter("client_id"); String clientId = request.getParameter("client_id");
String returnUrl = request.getParameter("redirect_uri"); String returnUrl = request.getParameter("redirect_uri");
System.out.println("redirect_uri1111111111111====="+returnUrl);
String authSource = request.getParameter("auth_source"); String authSource = request.getParameter("auth_source");
ClientItem clientItem = clientItemMap.get(clientId); ClientItem clientItem = clientItemMap.get(clientId);
if (null == clientItem) { if (null == clientItem) {
...@@ -99,6 +100,7 @@ public class AuthController { ...@@ -99,6 +100,7 @@ public class AuthController {
authLog.setClientName(clientItemMap.get(clientId).getClientName()); authLog.setClientName(clientItemMap.get(clientId).getClientName());
authLogService.save(authLog); authLogService.save(authLog);
CookiesUtil.setCookie(response, null, COOKIE_LOG_ID, authLog.getId(), 1); CookiesUtil.setCookie(response, null, COOKIE_LOG_ID, authLog.getId(), 1);
CookiesUtil.setCookie(response, null, "return_url", returnUrl, 1);
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("redirect_uri", returnUrl); params.put("redirect_uri", returnUrl);
params.put("auth_log_id", authLog.getId()); params.put("auth_log_id", authLog.getId());
...@@ -133,6 +135,7 @@ public class AuthController { ...@@ -133,6 +135,7 @@ public class AuthController {
public ModelAndView toLogin(HttpServletRequest request, HttpServletResponse response) { public ModelAndView toLogin(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
String loginUrl = request.getParameter("loginUrl"); String loginUrl = request.getParameter("loginUrl");
System.out.println("loginUrl222222222222222====="+loginUrl);
String idp = request.getParameter("idp"); String idp = request.getParameter("idp");
try { try {
String authLogId = CookiesUtil.getCookie(request, COOKIE_LOG_ID); String authLogId = CookiesUtil.getCookie(request, COOKIE_LOG_ID);
...@@ -163,6 +166,11 @@ public class AuthController { ...@@ -163,6 +166,11 @@ public class AuthController {
public ModelAndView loginsuccess(HttpServletRequest request, HttpServletResponse response, ModelAndView modelAndView) throws IOException { public ModelAndView loginsuccess(HttpServletRequest request, HttpServletResponse response, ModelAndView modelAndView) throws IOException {
modelAndView.setViewName("loginsuccess"); modelAndView.setViewName("loginsuccess");
String returnUrl = request.getParameter("redirect_uri"); String returnUrl = request.getParameter("redirect_uri");
String cookieReturnUrl = CookiesUtil.getCookie(request, "return_url");
if(cookieReturnUrl!=null){
returnUrl = cookieReturnUrl;
}
System.out.println("redirect_uri33333333333333333====="+returnUrl);
String authLogId = request.getParameter("auth_log_id"); String authLogId = request.getParameter("auth_log_id");
ClientDataInfo clientDataInfo = getUserInfoData(request); ClientDataInfo clientDataInfo = getUserInfoData(request);
AuthLog authLog = authLogService.getById(authLogId); AuthLog authLog = authLogService.getById(authLogId);
......
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