两套单点登录+两套系统待办跳转bug修复8

This commit is contained in:
wenlukang1 2025-07-04 15:10:44 +08:00
parent 06502dbbc0
commit 77a779b0f9
2 changed files with 16 additions and 8 deletions

View File

@ -43,7 +43,7 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
String secret;
String queryUrlOld = httpServletRequest.getQueryString();
//有code无需再次获取code直接结束
if (queryUrlOld.contains("code") && queryUrlOld.contains("sessionId") ) {
if (queryUrlOld != null && queryUrlOld.contains("code") && queryUrlOld.contains("sessionId")) {
String replace = queryUrlOld.replace("sessionId", "eossSessionId");
try {
httpServletResponse.sendRedirect(httpServletRequest.getRequestURI() + "?" + replace);
@ -78,9 +78,13 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
String userKey = "user_sessionId_" + userName; // 构造存储sessionId的键
String sessionId = cache.get(userKey);
String isNew = cache.get("isNew");
if (sessionId != null) {
AuthService.logout(ip, sessionId);
}
if (StringUtils.equals("true",isNew)){
ip = EOSS_IP2;
}
//退出系统跳转到eoss登录页
ssoUrl = ip + "/service/SGE-project-sctz-master/pc/dist/login.html";
} else {
@ -107,10 +111,13 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
String secret;
String queryUrlOld = httpServletRequest.getQueryString();
logger.info(String.format("getTrdSSOAuth→queryUrlOld%s", queryUrlOld));
DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
if (StringUtils.isNotEmpty(queryUrlOld) && queryUrlOld.contains("isNew")) {
ip = EOSS_IP2;
client = CLIENT_ID2;
secret = CLIENT_SECRET2;
cache.put("isNew", String.valueOf(queryUrlOld.contains("isNew")));
} else {
ip = EOSS_IP;
client = CLIENT_ID;
@ -160,7 +167,6 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
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);

View File

@ -244,8 +244,9 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
}
cache.put(ctx.getBusinessKey(), "true", z);
} else if (Objects.equals(shkd_type, "1")) {
String replace = form.toString().replace("&ado=view", "&ado=view&isNew=true");
// eoss 环境 待办
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDoNew(form.toString(), title, next.getLong("fid").toString(), userName, next.getString("fbillno"));
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDoNew(replace, title, next.getLong("fid").toString(), userName, next.getString("fbillno"));
// eoss 环境 已办
DealToDoHandler.get_DealToDoHandler().sendDealToDoNew(next.getLong("fid"), userName, next.getString("fbillno"));
if (ObjectUtils.isEmpty(shkd_cache)) {
@ -255,9 +256,10 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
}
cache.put(ctx.getBusinessKey(), "true", z);
} else if (Objects.equals(shkd_type, "2")) {
String replace = form.toString().replace("&ado=view", "&ado=view&isNew=true");
//二套环境 待办
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDo(form.toString(), title, next.getLong("fid").toString(), userName, next.getString("fbillno"));
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDoNew(form.toString(), title, next.getLong("fid").toString(), userName, next.getString("fbillno"));
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDoNew(replace, title, next.getLong("fid").toString(), userName, next.getString("fbillno"));
//二套环境 已办
DealToDoHandler.get_DealToDoHandler().sendDealToDo(next.getLong("fid"), userName, next.getString("fbillno"));
DealToDoHandler.get_DealToDoHandler().sendDealToDoNew(next.getLong("fid"), userName, next.getString("fbillno"));