From 35fe09a3e45896016b7d9179229fdde5ddc88349 Mon Sep 17 00:00:00 2001 From: huangweixiong Date: Fri, 11 Nov 2022 14:18:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B1=B1=E4=B8=9C=E9=80=9A?= =?UTF-8?q?=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/renren/modules/security/oauth2/Oauth2Filter.java | 7 ++++--- renren-admin/src/main/resources/application.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java index bc8e068e..7cf3d6be 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java +++ b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java @@ -206,13 +206,14 @@ public class Oauth2Filter extends AuthenticatingFilter { Integer expiresOffset = 60 * 5; expiresIn = expiresIn < expiresOffset ? expiresIn / 2 : expiresIn -expiresOffset; token.expiresIn = DateUtil.offset(new Date(), DateField.SECOND, expiresIn); + sdtToken = token; } } } } UrlBuilder urlBuilder = UrlBuilder.ofHttp(requestUri, CharsetUtil.CHARSET_UTF_8); CharSequence code = urlBuilder.getQuery().get("code"); - String userInfoUrl = String.format("%s/cgi-bin/user/getuserinfo?access_token=&s&code=%s", + String userInfoUrl = String.format("%s/cgi-bin/user/getuserinfo?access_token=%s&code=%s", apiUrl, sdtToken.accessToken, code); @@ -240,8 +241,8 @@ public class Oauth2Filter extends AuthenticatingFilter { cookie.setPath("/"); response.addCookie(cookie); response.addHeader(Constant.TOKEN_HEADER, currentToken); - //去掉凭证参数 - String removeCreditParame = ssoValidator.removeCreditParame(requestUri); + //回调不涉及其他页面回调,先写死回调首页 + String removeCreditParame = "http://" + urlBuilder.getHost() + ":" + urlBuilder.getPort() + "/#/home"; response.addHeader("REDIRECT", removeCreditParame); request.setAttribute(Constant.TOKEN_HEADER, currentToken); return executeLogin(request, response); diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index fd3cb7c3..aae389fa 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -165,5 +165,5 @@ shangdongtong: corpid: wwafa1a3005a15a672 agentId: 1001129 secret: fCcaNBVkCosL_O3cnQVQ0brqUUBZu3ruXuISj5k8FP8 - url: http://59.206.205.195:80 + url: http://15.72.183.90:7008/sdt