@aliyun-obv/api 0.0.55 → 0.0.57
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.
- package/dist/api.es.js +18 -3
- package/package.json +3 -3
package/dist/api.es.js
CHANGED
|
@@ -701,9 +701,24 @@ var __async$3 = (__this, __arguments, generator) => {
|
|
|
701
701
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
702
702
|
});
|
|
703
703
|
};
|
|
704
|
+
function getSlsBaseUrl() {
|
|
705
|
+
var _a, _b, _c;
|
|
706
|
+
if ((_a = window.ALIYUN_CONSOLE_CONFIG) == null ? void 0 : _a.LOCAL) {
|
|
707
|
+
return void 0;
|
|
708
|
+
}
|
|
709
|
+
const host = window.location.host;
|
|
710
|
+
if (host.includes("sls") && host.includes("console.aliyun.com")) {
|
|
711
|
+
return void 0;
|
|
712
|
+
}
|
|
713
|
+
if (((_b = window.ALIYUN_CONSOLE_CONFIG) == null ? void 0 : _b.ENV) === "pre" || ((_c = window.ALIYUN_CONSOLE_CONFIG) == null ? void 0 : _c.fEnv) === "pre") {
|
|
714
|
+
return `https://pre-sls.console.aliyun.com`;
|
|
715
|
+
}
|
|
716
|
+
return `https://sls.console.aliyun.com`;
|
|
717
|
+
}
|
|
704
718
|
const slsEasyFetch = new BaseFetch(finalFetch);
|
|
705
719
|
slsEasyFetch.defaults.postDefaultInit.headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
706
720
|
slsEasyFetch.defaults.postDefaultInit.headers["Accept"] = "application/json";
|
|
721
|
+
slsEasyFetch.defaults.baseURL = getSlsBaseUrl();
|
|
707
722
|
slsEasyFetch.defaults.errorHandler = errorHandler;
|
|
708
723
|
slsEasyFetch.defaults.beforeRequest = (url, params, init, options) => __async$3(void 0, null, function* () {
|
|
709
724
|
var _a;
|
|
@@ -743,7 +758,7 @@ slsEasyFetch.defaults.afterResponse = (r, options) => __async$3(void 0, null, fu
|
|
|
743
758
|
});
|
|
744
759
|
let hasError = false;
|
|
745
760
|
if (response.url.indexOf("/console/logs/getLogs.json") !== -1) {
|
|
746
|
-
const newData = Object.assign({}, data, response.headers.get("x-log-requestid"));
|
|
761
|
+
const newData = Object.assign({}, data, { requestid: response.headers.get("x-log-requestid") });
|
|
747
762
|
composedData = __spreadProps$1(__spreadValues$1({}, newData), {
|
|
748
763
|
response
|
|
749
764
|
});
|
|
@@ -765,11 +780,11 @@ slsEasyFetch.defaults.afterResponse = (r, options) => __async$3(void 0, null, fu
|
|
|
765
780
|
});
|
|
766
781
|
|
|
767
782
|
function getBaseUrl() {
|
|
768
|
-
var _a, _b;
|
|
783
|
+
var _a, _b, _c;
|
|
769
784
|
if ((_a = window.ALIYUN_CONSOLE_CONFIG) == null ? void 0 : _a.LOCAL) {
|
|
770
785
|
return `http://pre-observability:${window.location.port}`;
|
|
771
786
|
}
|
|
772
|
-
if (((_b = window.ALIYUN_CONSOLE_CONFIG) == null ? void 0 : _b.ENV) === "pre") {
|
|
787
|
+
if (((_b = window.ALIYUN_CONSOLE_CONFIG) == null ? void 0 : _b.ENV) === "pre" || ((_c = window.ALIYUN_CONSOLE_CONFIG) == null ? void 0 : _c.fEnv) === "pre") {
|
|
773
788
|
return `https://pre-observability.console.aliyun.com`;
|
|
774
789
|
}
|
|
775
790
|
return `https://observability.console.aliyun.com`;
|
package/package.json
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"urijs": "^1.19.1",
|
|
11
11
|
"lodash": "^4.17.21",
|
|
12
12
|
"@alicloud/console-base-error-prompt-proxy": "^1.9.12",
|
|
13
|
-
"@aliyun-obv/i18n": "0.0.
|
|
14
|
-
"@aliyun-obv/utils": "0.0.
|
|
13
|
+
"@aliyun-obv/i18n": "0.0.57",
|
|
14
|
+
"@aliyun-obv/utils": "0.0.57",
|
|
15
15
|
"@alifd/next": "^1.27.11",
|
|
16
16
|
"styled-components": "^5.2.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {},
|
|
19
|
-
"version": "0.0.
|
|
19
|
+
"version": "0.0.57"
|
|
20
20
|
}
|