diff --git a/src/http/http_client.c b/src/http/http_client.c index 3867633..53fcbb5 100644 --- a/src/http/http_client.c +++ b/src/http/http_client.c @@ -21,6 +21,7 @@ #include "lite-utils.h" #include "ca.h" #include "utils_sha2.h" +#include "uiot_export.h" int IOT_HTTP_Get_Token(const char *product_sn, const char *device_sn, const char *device_sercret, char *token) { @@ -87,9 +88,8 @@ int IOT_HTTP_Get_Token(const char *product_sn, const char *device_sn, const char HAL_Snprintf(http_client_post->header, 1024, "Content-Type: application/json\r\nAuthorization: %s\r\nbody: %s\r\n",mac_output_char,http_data_post->post_buf); const char *ca_crt = iot_https_ca_get(); - char *url = (char *)"https://http-cn-sh2.iot.ucloud.cn/auth"; - ret = http_client_common(http_client_post, url, 443, ca_crt, HTTP_POST, http_data_post,5000); + ret = http_client_common(http_client_post, UIOT_AUTH_URL, 443, ca_crt, HTTP_POST, http_data_post,5000); if(SUCCESS_RET != ret) { LOG_ERROR("HTTP_POST error\n"); diff --git a/src/sdk-impl/uiot_export.h b/src/sdk-impl/uiot_export.h index 2434df2..11d2da5 100644 --- a/src/sdk-impl/uiot_export.h +++ b/src/sdk-impl/uiot_export.h @@ -57,14 +57,15 @@ extern "C" { /* MQTT连接域名 */ //上海区域域名 #define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-sh2.iot.ucloud.cn" +#define UIOT_AUTH_URL "https://http-cn-sh2.iot.ucloud.cn/auth" #define UIOT_UPLOAD_FILE_URL "https://file-cn-sh2.iot.ucloud.cn/api/v1/url" /* //使用广州区域时替换为 #define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-gd.iot.ucloud.cn" +#define UIOT_AUTH_URL "https://http-cn-gd.iot.ucloud.cn/auth" #define UIOT_UPLOAD_FILE_URL "https://file-cn-gd.iot.ucloud.cn/api/v1/url" */ - #include "uiot_export_mqtt.h" #include "uiot_defs.h"