@cloudbase/manager-node 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,6 +70,14 @@ class CloudService {
|
|
|
70
70
|
cam: 'https://cam.tencentcloudapi.com',
|
|
71
71
|
cdn: 'https://cdn.tencentcloudapi.com'
|
|
72
72
|
};
|
|
73
|
+
// 检测环境变量,云梯账号走内网域名
|
|
74
|
+
const USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT";
|
|
75
|
+
const intranetUrlMap = Object.keys(urlMap).map((service) => ({
|
|
76
|
+
[service]: `https://${service}.internal.tencentcloudapi.com`,
|
|
77
|
+
})).reduce((acc, cur) => (Object.assign(Object.assign({}, acc), cur)), {});
|
|
78
|
+
if (USE_INTERNAL_ENDPOINT in process.env) {
|
|
79
|
+
return intranetUrlMap[this.service];
|
|
80
|
+
}
|
|
73
81
|
if (urlMap[this.service]) {
|
|
74
82
|
return urlMap[this.service];
|
|
75
83
|
}
|
package/package.json
CHANGED
|
@@ -91,6 +91,18 @@ export class CloudService {
|
|
|
91
91
|
cam: 'https://cam.tencentcloudapi.com',
|
|
92
92
|
cdn: 'https://cdn.tencentcloudapi.com'
|
|
93
93
|
}
|
|
94
|
+
|
|
95
|
+
// 检测环境变量,云梯账号走内网域名
|
|
96
|
+
const USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT"
|
|
97
|
+
|
|
98
|
+
const intranetUrlMap = Object.keys(urlMap).map((service) => ({
|
|
99
|
+
[service]: `https://${service}.internal.tencentcloudapi.com`,
|
|
100
|
+
})).reduce((acc, cur) => ({ ...acc, ...cur }), {})
|
|
101
|
+
|
|
102
|
+
if(USE_INTERNAL_ENDPOINT in process.env) {
|
|
103
|
+
return intranetUrlMap[this.service]
|
|
104
|
+
}
|
|
105
|
+
|
|
94
106
|
if (urlMap[this.service]) {
|
|
95
107
|
return urlMap[this.service]
|
|
96
108
|
} else {
|