重定向缺少&符号修改

This commit is contained in:
owan 2024-11-08 19:14:33 +08:00
parent dc8eb2db8f
commit f198d19b1d
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,6 @@ public class AuthService {
public static String accessToken(String code,String eoss_ip,String client_id,String client_secret) { public static String accessToken(String code,String eoss_ip,String client_id,String client_secret) {
HttpHeaders api_headers = new HttpHeaders();//请求头 HttpHeaders api_headers = new HttpHeaders();//请求头
api_headers.add("Content-Type", "application/json; charset=utf-8"); api_headers.add("Content-Type", "application/json; charset=utf-8");
// String param= String.format("client_id=%s&client_secret=%s&grant_type=code&authType=0&code= %s",CLIENT_ID,CLIENT_SECRET,code);
HashMap<String, Object> requestBody = new HashMap<>(); HashMap<String, Object> requestBody = new HashMap<>();
requestBody.put("client_id", client_id); requestBody.put("client_id", client_id);
requestBody.put("client_secret", client_secret); requestBody.put("client_secret", client_secret);

View File

@ -33,6 +33,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) {
s = "http://10.1.7.85:8022/ierp/auth/callbackTrdSSO.do?tenantNo=ctsk-dev&sandboxNo=2063179586270661632";
//认证中心的登录地址 //认证中心的登录地址
logger.info(String.format("eoss_ip:%s,client_id:%s,client_secret:%s,重定向地址:%s",EOSS_IP,CLIENT_ID,CLIENT_SECRET,s)); logger.info(String.format("eoss_ip:%s,client_id:%s,client_secret:%s,重定向地址:%s",EOSS_IP,CLIENT_ID,CLIENT_SECRET,s));
try { try {
@ -40,8 +41,8 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
/** /**
* 获取授权码 * 获取授权码
*/ */
String ssourl=String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&authType=0redirect_uri=%s", String ssourl=String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&authType=0&redirect_uri=%s",
EOSS_IP,CLIENT_ID,s); EOSS_IP,CLIENT_ID,EOSS_IP);
logger.info(String.format("重定向地址→sendRedirect%s",ssourl)); logger.info(String.format("重定向地址→sendRedirect%s",ssourl));
httpServletResponse.sendRedirect(ssourl); httpServletResponse.sendRedirect(ssourl);
} catch (IOException e) { } catch (IOException e) {