Просмотр исходного кода

修复拉卡拉设置费率获取token问题

lcl 4 месяцев назад
Родитель
Сommit
20d6fc4f96
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      AppStart/Helper/PublicImportDataService.cs

+ 2 - 1
AppStart/Helper/PublicImportDataService.cs

@@ -1305,6 +1305,7 @@ namespace MySystem
         // 生产环境
         string lklClientId = "guanmi";
         string lklClientSecret = "IxQfXIPae9su7HNB";
+        string lklChangeAgentNo = "22811427";
         string userName = "18581888998";
         string password = "Kxs@666888";
         string lklReqUrl = "https://tkapi.lakala.com";
@@ -1341,7 +1342,7 @@ namespace MySystem
                 headers.Add("client_id", lklClientId);
                 headers.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(lklClientId + ":" + lklClientSecret)));
                 Utils.WriteLog("请求地址\n" + lklReqUrl + "/htkauth/oauth/token", "拉卡拉获取Token2");
-                string reqStr = "grant_type=password&username=" + userName + "&password=" + password;
+                string reqStr = "grant_type=password&username=" + userName + "&password=" + password + "&scope=all&client_id=" + lklClientId + "&client_secret=" + lklClientSecret + "&changeAgentNo=" + lklChangeAgentNo;
                 Utils.WriteLog("请求参数\n" + reqStr, "拉卡拉获取Token2");
                 string result = function.PostWebRequest(lklReqUrl + "/htkauth/oauth/token", reqStr, headers);
                 Utils.WriteLog("返回报文\n" + result + "\n\n\n", "拉卡拉获取Token2");