Commit a0282805 by chenzx

打印网络请求返回信息和上传参数

parent 24f207e5
...@@ -79,9 +79,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -79,9 +79,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
Map map=new HashMap(); Map map=new HashMap();
map.put("grant_type","authorization_code"); map.put("grant_type","authorization_code");
map.put("client_id",clientId); map.put("client_id",clientId);
map.put("clientSecret",clientSecret); map.put("client_secret",clientSecret);
map.put("redirect_uri",ssoUrl); map.put("redirect_uri",ssoUrl);
map.put("code",code); map.put("code",code);
System.out.println("param:--------->"+map.toString());
JSONObject jsonObject = null; JSONObject jsonObject = null;
try{ try{
jsonObject = JSONObject.fromObject(HttpClientUtil.doPost("http://cas.zua.edu.cn/oauth2.0/accessToken",map)); jsonObject = JSONObject.fromObject(HttpClientUtil.doPost("http://cas.zua.edu.cn/oauth2.0/accessToken",map));
...@@ -92,6 +93,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -92,6 +93,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
String accessToken=""; String accessToken="";
if(null != jsonObject){ if(null != jsonObject){
//返回内容 access_token=AT-1-vDqPefqwHJl39iUtsAh19oI1vwAIQn6k&expires_in=28800 //返回内容 access_token=AT-1-vDqPefqwHJl39iUtsAh19oI1vwAIQn6k&expires_in=28800
System.out.println("request return:--------->"+jsonObject.toString());
accessToken=jsonObject.get("accessToken").toString(); accessToken=jsonObject.get("accessToken").toString();
}else{ }else{
System.out.println("jsonObject is null"); System.out.println("jsonObject is null");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment