From 38b3548433f54e9e13583f7c51d8512b0a9021cf Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期五, 22 九月 2023 08:59:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/PasswordFreeLoginController.java |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/PasswordFreeLoginController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/PasswordFreeLoginController.java
index 5cb6929..12b129d 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/PasswordFreeLoginController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/PasswordFreeLoginController.java
@@ -10,10 +10,14 @@
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import org.springframework.web.servlet.view.RedirectView;
 
 import javax.annotation.Resource;
+import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
 
 import java.io.IOException;
 
@@ -56,19 +60,15 @@
 	 * @throws Exception
 	 */
 	@GetMapping("/ssoLogin")
-	public String oaSsoLogin(HttpServletRequest request) throws IOException {
+	public String oaSsoLogin(HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes) throws IOException, ServletException {
 		String token;
 		try {
 			token = passwordFreeLoginService.ssoFreeLogin(request);
 		}catch (Exception e){
 			throw new ServiceException("鍗曠偣鐧诲綍鑾峰彇token澶辫触:"+e.getMessage());
 		}
-//		response.setHeader("tokenInfo",token);
-//		response.setCharacterEncoding("utf-8");
-//		response.setContentType("application/json");
-		request.setAttribute("tokenInfo",token);
-		//response.sendRedirect(ssoRedirectAddr);
-		return "forward:/sso";
+		redirectAttributes.addFlashAttribute("tokenInfo",token);
+		return "redirect:"+ssoRedirectAddr;
 	}
 
 }

--
Gitblit v1.9.3