From 24b8c2ceb717b2aa67e182e21a4088657ad4b079 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 21 九月 2023 16:24:45 +0800 Subject: [PATCH] 代码提交 --- 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