tianwu.sun 3 月之前
父節點
當前提交
499cf5a004
共有 1 個文件被更改,包括 17 次插入1 次删除
  1. 17 1
      src/main/java/com/bootdo/system/controller/LoginController.java

+ 17 - 1
src/main/java/com/bootdo/system/controller/LoginController.java

@@ -137,7 +137,23 @@ public class LoginController extends BaseController {
     @ResponseBody
     @GetMapping("/getLoginUrl")
     String getLoginUrl() {
-        return loginUrl;
+        //return loginUrl;
+
+        //获取当前登录账号信息
+        UserDO currUser = ShiroUtils.getUser();
+
+        if(logoutRedirectUrl.contains("http")){
+            //返回第三方退出登录接口
+            //回调地址示例:https://testmicrosrv.scca.com.cn:9668/session/end?client_id=f104472f-02f4-6ab6-f6dc&access_token=HRMpcEUueorxSGQccNolRB2vkpaxnWHGvQonRtnoKEr3Z7KQthcUFz8jdaSD&logout_redirect_uri=http://124.70.58.209:19087/login
+            String logoutRedirectBackUrl = permAuthPrefix + "/session/end" +
+                    "?client_id=" + this.uniIdentAuthAppId +
+                    "&access_token=" + redisUtil.hget(Constants.USERNAME_ACCESS_TOKEN, currUser.getUsername()) +
+                    "&logout_redirect_uri=" + this.logoutRedirectUrl;
+            logger.error("logoutRedirectBackUrl==============="+logoutRedirectBackUrl);
+            return "redirect:" + logoutRedirectBackUrl;
+        }else {
+            return "redirect:" + logoutRedirectUrl;
+        }
     }
 
     @GetMapping("/login")