新oa待办跳转到待办页面bug修复5添加日志
This commit is contained in:
parent
b99c9dc761
commit
a508cf5e7f
|
@ -37,6 +37,7 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void callTrdSSOLogin(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, String s) {
|
public void callTrdSSOLogin(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, String s) {
|
||||||
|
logger.info(String.format("callTrdSSOLogin→httpServletRequest:%s", httpServletRequest));
|
||||||
|
|
||||||
String ip;
|
String ip;
|
||||||
String client;
|
String client;
|
||||||
|
@ -52,29 +53,22 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
||||||
client = CLIENT_ID;
|
client = CLIENT_ID;
|
||||||
secret = CLIENT_SECRET;
|
secret = CLIENT_SECRET;
|
||||||
}
|
}
|
||||||
|
logger.info(String.format("callTrdSSOLogin→queryUrl:%s", queryUrl));
|
||||||
String ssourl = ip + "/service/SGE-project-sctz-master/pc/dist/login.html";
|
String ssourl = ip + "/service/SGE-project-sctz-master/pc/dist/login.html";
|
||||||
//图标登录到首页
|
|
||||||
if (!queryUrl.contains("yzjShareOpen.do")) {
|
|
||||||
try {
|
try {
|
||||||
|
//非待办登录到首页
|
||||||
|
if (!queryUrl.contains("yzjShareOpen.do")) {
|
||||||
//重定向的统一认证的地址 获取授权码
|
//重定向的统一认证的地址 获取授权码
|
||||||
ssourl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&sessionKeep=true&authType=0&redirect_uri=%s",
|
ssourl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&sessionKeep=true&authType=0&redirect_uri=%s",
|
||||||
ip, client, s);
|
ip, client, s);
|
||||||
logger.info(String.format("重定向地址→sendRedirect:%s", ssourl));
|
|
||||||
httpServletResponse.sendRedirect(ssourl);
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
queryUrl = Base64.getEncoder().encodeToString(queryUrl.getBytes(StandardCharsets.UTF_8));
|
queryUrl = Base64.getEncoder().encodeToString(queryUrl.getBytes(StandardCharsets.UTF_8));
|
||||||
// String skIp = httpServletRequest.getRemo
|
|
||||||
String skUrl = RevProxyUtil.getURLContextPath(httpServletRequest);
|
String skUrl = RevProxyUtil.getURLContextPath(httpServletRequest);
|
||||||
logger.info("getURLContextPath:" + skUrl);
|
logger.info("callTrdSSOLogin→getURLContextPath:" + skUrl);
|
||||||
String redirect = skIP + "/index.html?param=" + queryUrl;
|
String redirect = skIP + "/index.html?param=" + queryUrl;
|
||||||
logger.info("skip:" + skUrl);
|
logger.info("callTrdSSOLogin→skip:" + redirect);
|
||||||
//认证中心的登录地址
|
//认证中心的登录地址
|
||||||
logger.info(String.format("eoss_ip:%s,client_id:%s,client_secret:%s,重定向地址:%s", ip, client, secret, s));
|
logger.info(String.format("eoss_ip:%s,client_id:%s,client_secret:%s,重定向地址:%s", ip, client, secret, s));
|
||||||
|
|
||||||
try {
|
|
||||||
if (httpServletRequest.getRequestURI().contains("/auth/logout.do")) {
|
if (httpServletRequest.getRequestURI().contains("/auth/logout.do")) {
|
||||||
String userName = UserServiceHelper.getCurrentUser("name").getString("name");
|
String userName = UserServiceHelper.getCurrentUser("name").getString("name");
|
||||||
DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
|
DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
|
||||||
|
@ -87,14 +81,14 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
||||||
//重定向的统一认证的地址 获取授权码
|
//重定向的统一认证的地址 获取授权码
|
||||||
ssourl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&sessionKeep=true&authType=0&redirect_uri=%s",
|
ssourl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&sessionKeep=true&authType=0&redirect_uri=%s",
|
||||||
ip, client, redirect);
|
ip, client, redirect);
|
||||||
logger.info(String.format("重定向地址→sendRedirect:%s", ssourl));
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
logger.info(String.format("callTrdSSOLogin→→sendRedirect:%s", ssourl));
|
||||||
httpServletResponse.sendRedirect(ssourl);
|
httpServletResponse.sendRedirect(ssourl);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实现苍穹调用认证系统的接口解析认证凭据返回用户信息,按数据格式返回认证结果。
|
* 实现苍穹调用认证系统的接口解析认证凭据返回用户信息,按数据格式返回认证结果。
|
||||||
|
@ -120,16 +114,15 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
||||||
String code = httpServletRequest.getParameter("code");
|
String code = httpServletRequest.getParameter("code");
|
||||||
logger.info(String.format("getTrdSSOAuth→授权码code:%s", code));
|
logger.info(String.format("getTrdSSOAuth→授权码code:%s", code));
|
||||||
if (StringUtils.isEmpty(code)) {
|
if (StringUtils.isEmpty(code)) {
|
||||||
logger.error("getTrdSSOAuth→授权码code为空");
|
|
||||||
result.setSucess(false);
|
result.setSucess(false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//调用EOSS获取token接口
|
//调用EOSS获取token接口
|
||||||
String access_token = AuthService.accessToken(code, ip, client, secret);
|
String access_token = AuthService.accessToken(code, ip, client, secret);
|
||||||
logger.info(String.format("accessToken返回数据:%s", access_token));
|
logger.info(String.format("getTrdSSOAuth→accessToken返回数据:%s", access_token));
|
||||||
//调用EOSS获取用户信息接口
|
//调用EOSS获取用户信息接口
|
||||||
String user = AuthService.getUserInfo(access_token, ip, client, secret);
|
String user = AuthService.getUserInfo(access_token, ip, client, secret);
|
||||||
logger.info(String.format("getUserInfo返回数据:%s", user));
|
logger.info(String.format("getTrdSSOAuth→getUserInfo返回数据:%s", user));
|
||||||
String param = httpServletRequest.getParameter("param");
|
String param = httpServletRequest.getParameter("param");
|
||||||
//解码
|
//解码
|
||||||
if (param != null) {
|
if (param != null) {
|
||||||
|
|
Loading…
Reference in New Issue