Merge pull request #11298 from dataease/pr@dev-v2@fix_copilot

fix: copilot token error
This commit is contained in:
Junjun 2024-07-31 18:57:16 +08:00 committed by GitHub
commit d5cc3aa380
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,7 +58,6 @@ public class CopilotAPI {
JSONObject json = new JSONObject();
json.put("licenseText", license);
HttpClientConfig httpClientConfig = new HttpClientConfig();
httpClientConfig.addHeader("Authorization", basicAuth(getConfig().getUsername(), getConfig().getPwd()));
String tokenJson = HttpClientUtil.post(url, json.toString(), httpClientConfig);
return (String) JsonUtil.parse(tokenJson, Map.class).get("accessToken");
}
@ -66,7 +65,6 @@ public class CopilotAPI {
public String getFreeToken() throws Exception {
String url = getConfig().getCopilotUrl() + FREE_TOKEN;
HttpClientConfig httpClientConfig = new HttpClientConfig();
httpClientConfig.addHeader("Authorization", basicAuth(getConfig().getUsername(), getConfig().getPwd()));
String tokenJson = HttpClientUtil.post(url, "", httpClientConfig);
return (String) JsonUtil.parse(tokenJson, Map.class).get("accessToken");
}