|
|
@@ -90,11 +90,22 @@ bool CZhipuziHttpClient::Login(std::string& errmsg)
|
|
|
|
|
|
if (m_client.m_version_type == "1")
|
|
|
{
|
|
|
- m_client.m_yewu_ur = "https://cyapi.zhipuzi.com/pos";
|
|
|
+ if (m_client.m_env == RELEASE)
|
|
|
+ {
|
|
|
+ m_client.m_yewu_url = "https://cyapi.zhipuzi.com/pos";
|
|
|
+ }
|
|
|
+ else if (m_client.m_env == TEST)
|
|
|
+ {
|
|
|
+ m_client.m_yewu_url = "https://cyapi-test.zhipuzi.com/pos";
|
|
|
+ }
|
|
|
+ else if (m_client.m_env == DEV)
|
|
|
+ {
|
|
|
+ m_client.m_yewu_url = "https://cyapi-test.zhipuzi.com/pos";
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- m_client.m_yewu_ur = "https://lsapi.zhipuzi.com/pos";
|
|
|
+ m_client.m_yewu_url = "https://lsapi.zhipuzi.com/pos";
|
|
|
}
|
|
|
|
|
|
rapidjson::Value& v_lwm_sess_token = v_data["lwm_sess_token"];
|
|
|
@@ -114,7 +125,7 @@ bool CZhipuziHttpClient::Request(std::string url, std::map<string, string> param
|
|
|
params["username"] = m_client.m_username;
|
|
|
params["nonce"] = nonce;
|
|
|
params["timestamp"] = timestamp;
|
|
|
- params["url"] = m_client.m_yewu_ur + url;
|
|
|
+ params["url"] = m_client.m_yewu_url + url;
|
|
|
params["machinecode"] = "d31a20c2567006c5";
|
|
|
|
|
|
//计算签名
|
|
|
@@ -164,7 +175,7 @@ bool CZhipuziHttpClient::Request(std::string url, std::map<string, string> param
|
|
|
LOG_INFO("postString:" << postString.c_str());
|
|
|
|
|
|
CHttpClient m_httpClient;
|
|
|
- int ret = m_httpClient.Posts(m_client.m_yewu_ur + url, postString, response, NULL);
|
|
|
+ int ret = m_httpClient.Posts(m_client.m_yewu_url + url, postString, response, NULL);
|
|
|
|
|
|
LOG_INFO("response:" << response.c_str());
|
|
|
|
|
|
@@ -236,7 +247,7 @@ bool CZhipuziHttpClient::RequestNew(std::string url, std::map<string, string> pa
|
|
|
LOG_INFO("postString:" << postString.c_str());
|
|
|
|
|
|
CHttpClient m_httpClient;
|
|
|
- int ret = m_httpClient.Posts(m_client.m_yewu_ur + url, postString, response, NULL);
|
|
|
+ int ret = m_httpClient.Posts(m_client.m_yewu_url + url, postString, response, NULL);
|
|
|
|
|
|
LOG_INFO("response:" << response.c_str());
|
|
|
|