新oa待办跳转到待办页面bug修复9

This commit is contained in:
wenlukang1 2025-06-30 22:26:13 +08:00
parent 42d561d6fa
commit a28e17e5fc
1 changed files with 23 additions and 23 deletions

View File

@ -79,7 +79,7 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
queryUrl = Base64.getEncoder().encodeToString(queryUrl.getBytes(StandardCharsets.UTF_8));
String skUrl = RevProxyUtil.getURLContextPath(httpServletRequest);
logger.info("callTrdSSOLogin→getURLContextPath" + skUrl);
String redirect = skIP + "/index.html?param=" + queryUrl;
String redirect = "http://127.0.0.1:8881/ierp" + "/index.html?param=" + queryUrl;
logger.info("callTrdSSOLogin→skip" + redirect);
//重定向的统一认证的地址 获取授权码
ssourl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&sessionKeep=true&authType=0&redirect_uri=%s",
@ -119,12 +119,7 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
result.setSucess(false);
return result;
}
//调用EOSS获取token接口
String access_token = AuthService.accessToken(code, ip, client, secret);
logger.info(String.format("getTrdSSOAuth→accessToken返回数据%s", access_token));
//调用EOSS获取用户信息接口
String user = AuthService.getUserInfo(access_token, ip, client, secret);
logger.info(String.format("getTrdSSOAuth→getUserInfo返回数据%s", user));
String param = httpServletRequest.getParameter("param");
//解码
if (param != null) {
@ -134,27 +129,32 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
//获取返回的 sessionId
String sessionId = httpServletRequest.getParameter("sessionId");
logger.info(String.format("getTrdSSOAuth→sessionId%s", sessionId));
String userKey = "user_sessionId_" + user;
//存储sessionId用于退出系统
DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
cache.put(userKey, sessionId);
//二次重定向到待办页面并且不携带EOSS返回的sessionId
httpServletResponse.sendRedirect(httpServletRequest.getRequestURI() + "?" + paramString + "&code=" + code);
httpServletResponse.sendRedirect(httpServletRequest.getRequestURI() + "?" + paramString + "&code=" + code+"&eossSessionId="+sessionId);
//二次重定向进入
if (StringUtils.isNotEmpty(code) && sessionId == null) {
//调用EOSS获取token接口
String access_token = AuthService.accessToken(code, ip, client, secret);
logger.info(String.format("getTrdSSOAuth→accessToken返回数据%s", access_token));
//调用EOSS获取用户信息接口
String user = AuthService.getUserInfo(access_token, ip, client, secret);
logger.info(String.format("getTrdSSOAuth→getUserInfo返回数据%s", user));
String userKey = "user_sessionId_" + user;
//存储sessionId用于退出系统
DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
cache.put(userKey, httpServletRequest.getParameter("eossSessionId"));
//当前返回类型手机用户名email工号
result.setUserType(UserProperType.UserName);
result.setUser(user);
result.setSucess(true);
logger.info("SSO用户登录成功进入苍穹系统");
}else{
result.setSucess(false);
}
} catch (IOException e) {
logger.error("二次重定向到待办页面异常!" + e.getMessage());
throw new RuntimeException(e);
}
result.setSucess(false);
return result;
}
//二次重定向进入
result.setUserType(UserProperType.UserName);
if (StringUtils.isNotEmpty(code) && user != null) {
//当前返回类型手机用户名email工号
result.setUserType(UserProperType.UserName);
result.setUser(user);
result.setSucess(true);
logger.info("SSO用户登录成功进入苍穹系统");
}
return result;
}