@alicloud/alfa-core 1.5.4 → 1.5.6-alpha.0
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/es/utils/getConfig.js
CHANGED
|
@@ -129,7 +129,7 @@ export var getConfigV2 = /*#__PURE__*/function () {
|
|
|
129
129
|
_context2.prev = 15;
|
|
130
130
|
_context2.t0 = _context2["catch"](8);
|
|
131
131
|
case 17:
|
|
132
|
-
return _context2.abrupt("return",
|
|
132
|
+
return _context2.abrupt("return", undefined);
|
|
133
133
|
case 18:
|
|
134
134
|
case "end":
|
|
135
135
|
return _context2.stop();
|
|
@@ -11,9 +11,10 @@ var getCurrentCdnHost = function getCurrentCdnHost() {
|
|
|
11
11
|
if (win.__alfa_cdn_host__) {
|
|
12
12
|
return win.__alfa_cdn_host__;
|
|
13
13
|
}
|
|
14
|
+
var scriptUrl = ((_document$currentScri = document.currentScript) === null || _document$currentScri === void 0 ? void 0 : _document$currentScri.src) || import.meta.url;
|
|
14
15
|
|
|
15
16
|
// document.currentScript 可能为 null
|
|
16
|
-
var _URL = new URL(
|
|
17
|
+
var _URL = new URL(scriptUrl),
|
|
17
18
|
hostname = _URL.hostname;
|
|
18
19
|
var parts = hostname.split('.');
|
|
19
20
|
var _currentCdnHost = parts.length > 2 ? parts.slice(-2).join('.') : hostname;
|
package/lib/utils/getConfig.js
CHANGED
|
@@ -136,7 +136,7 @@ var getConfigV2 = exports.getConfigV2 = /*#__PURE__*/function () {
|
|
|
136
136
|
_context2.prev = 15;
|
|
137
137
|
_context2.t0 = _context2["catch"](8);
|
|
138
138
|
case 17:
|
|
139
|
-
return _context2.abrupt("return",
|
|
139
|
+
return _context2.abrupt("return", undefined);
|
|
140
140
|
case 18:
|
|
141
141
|
case "end":
|
|
142
142
|
return _context2.stop();
|
|
@@ -18,9 +18,10 @@ var getCurrentCdnHost = function getCurrentCdnHost() {
|
|
|
18
18
|
if (win.__alfa_cdn_host__) {
|
|
19
19
|
return win.__alfa_cdn_host__;
|
|
20
20
|
}
|
|
21
|
+
var scriptUrl = ((_document$currentScri = document.currentScript) === null || _document$currentScri === void 0 ? void 0 : _document$currentScri.src) || import.meta.url;
|
|
21
22
|
|
|
22
23
|
// document.currentScript 可能为 null
|
|
23
|
-
var _URL = new URL(
|
|
24
|
+
var _URL = new URL(scriptUrl),
|
|
24
25
|
hostname = _URL.hostname;
|
|
25
26
|
var parts = hostname.split('.');
|
|
26
27
|
var _currentCdnHost = parts.length > 2 ? parts.slice(-2).join('.') : hostname;
|
package/package.json
CHANGED