APP代码提交

This commit is contained in:
zhaol 2025-07-02 14:11:28 +08:00
parent 1386bc7008
commit b64b79d0a6

View File

@ -23,9 +23,8 @@ public class App {
String authoStr = geAuthorization(clientId, clientSecret); String authoStr = geAuthorization(clientId, clientSecret);
HashMap<String, String> HeaderMap = new HashMap(); HashMap<String, String> HeaderMap = new HashMap();
//HeaderMap.put("Content-Type", "application/x-www-form-urlencoded"); //HeaderMap.put("Content-Type", "application/x-www-form-urlencoded");
HeaderMap.put("grant_type","authorization_code"); HeaderMap.put("grant_type", "authorization_code");
HeaderMap.put("Authorization", authoStr); HeaderMap.put("Authorization", authoStr);
HeaderMap.put("appkey", "676a5c4adf8dd659219cb2a0");
//HeaderMap.put("accept", "*/*"); //HeaderMap.put("accept", "*/*");
//HeaderMap.put("connection", "Keep-Alive"); //HeaderMap.put("connection", "Keep-Alive");
System.out.println("url地址为=============="+url); System.out.println("url地址为=============="+url);
@ -44,12 +43,11 @@ public class App {
String url = "https://idm.yili.com:7777/ms_oauth/resources/userprofile/me"; String url = "https://idm.yili.com:7777/ms_oauth/resources/userprofile/me";
String authoStr = token; String authoStr = token;
HashMap<String, String> HeaderMap = new HashMap(); HashMap<String, String> HeaderMap = new HashMap<>();
HeaderMap.put("Content-Type", "application/x-www-form-urlencoded"); HeaderMap.put("Content-Type", "application/x-www-form-urlencoded");
HeaderMap.put("Authorization", authoStr); HeaderMap.put("Authorization", authoStr);
HeaderMap.put("accept", "*/*"); HeaderMap.put("accept", "*/*");
HeaderMap.put("connection", "Keep-Alive"); HeaderMap.put("connection", "Keep-Alive");
HeaderMap.put("appkey", "676a5c4adf8dd659219cb2a0");
// do request get // do request get
userInfoJson = HttpJavaUtil.doGet(url, HeaderMap); userInfoJson = HttpJavaUtil.doGet(url, HeaderMap);
System.out.println(userInfoJson); System.out.println(userInfoJson);