getTokenUrl
__gZxrYDgj8OpfztxSuUg
__gZxrYDgj8OpfztxSuUg
" + hostUrl);
var JSONString = URLConnector.post(hostUrl).header("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8").execute().body();
println("JSONString==>" + JSONString);
var str = eval('('+JSONString+')');
var access_token = str.data.access_token;
request.getSession().setAttribute(userId + "saas_access_token",access_token);
var thirdSessionId = str.data.thirdSessionId;
request.getSession().setAttribute(userId + "thirdSessionId",thirdSessionId);
var refresh_token = str.data.refresh_token;
request.getSession().setAttribute(userId + "refresh_token",refresh_token);
var sessionId = str.data.sessionId;
request.getSession().setAttribute(userId + "sessionId",sessionId);
var token_type = str.data.token_type;
request.getSession().setAttribute(userId + "token_type",token_type);
var expires_in = str.data.expires_in;
request.getSession().setAttribute(userId + "expires_in",expires_in);
url += "access_token="+access_token+
"&thirdSessionId="+thirdSessionId+
"&refresh_token="+refresh_token+
"&sessionId="+sessionId+
"&token_type="+token_type+
"&expires_in="+expires_in;
//}else{
// println("缓存token获取中……")
// url += "access_token="+userAccessToken+
// "&thirdSessionId="+getSession(userId + "thirdSessionId")+
// "&refresh_token="+getSession(userId + "refresh_token")+
// "&sessionId="+getSession(userId + "sessionId")+
// "&token_type="+getSession(userId + "token_type")+
// "&expires_in="+getSession(userId + "expires_in");
//}
return url;
}]]>
0