@alicloud/alfa-core 1.5.12 → 1.5.13-beta.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.
- package/es/utils/getConfig.js +5 -2
- package/lib/utils/getConfig.js +5 -2
- package/package.json +1 -1
package/es/utils/getConfig.js
CHANGED
|
@@ -93,7 +93,7 @@ export var getConfig = /*#__PURE__*/function () {
|
|
|
93
93
|
*/
|
|
94
94
|
export var getConfigV2 = /*#__PURE__*/function () {
|
|
95
95
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
|
|
96
|
-
var releaseConfig, _ref5, relatedConsoleAppId, currentConfig, _ALIYUN_CONSOLE_CONFI, res, _t3;
|
|
96
|
+
var releaseConfig, _ref5, relatedConsoleAppId, currentConfig, _ALIYUN_CONSOLE_CONFI, mainDomain, res, _t3;
|
|
97
97
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
98
98
|
while (1) switch (_context2.prev = _context2.next) {
|
|
99
99
|
case 0:
|
|
@@ -117,8 +117,11 @@ export var getConfigV2 = /*#__PURE__*/function () {
|
|
|
117
117
|
return _context2.abrupt("return", currentConfig);
|
|
118
118
|
case 2:
|
|
119
119
|
_context2.prev = 2;
|
|
120
|
+
// 内网域名(如 aliyun-inc.com / alibaba-inc.com)的 fecs 服务实际部署在去掉 `-inc` 的公网域名上,
|
|
121
|
+
// 这里剥离一级域名结尾的 `-inc` 后缀,确保 fecs 请求命中正确域名
|
|
122
|
+
mainDomain = parseEnv().MAIN_DOMAIN.replace(/-inc(?=\.[^.]+$)/, '');
|
|
120
123
|
_context2.next = 3;
|
|
121
|
-
return request.get("https://".concat(config.env !== 'prod' ? 'pre-' : '', "fecs.console.").concat(
|
|
124
|
+
return request.get("https://".concat(config.env !== 'prod' ? 'pre-' : '', "fecs.console.").concat(mainDomain, "/api/alfa/console/config?appId=").concat(relatedConsoleAppId), {
|
|
122
125
|
withCredentials: true
|
|
123
126
|
});
|
|
124
127
|
case 3:
|
package/lib/utils/getConfig.js
CHANGED
|
@@ -100,7 +100,7 @@ var getConfig = exports.getConfig = /*#__PURE__*/function () {
|
|
|
100
100
|
*/
|
|
101
101
|
var getConfigV2 = exports.getConfigV2 = /*#__PURE__*/function () {
|
|
102
102
|
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(config) {
|
|
103
|
-
var releaseConfig, _ref5, relatedConsoleAppId, currentConfig, _ALIYUN_CONSOLE_CONFI, res, _t3;
|
|
103
|
+
var releaseConfig, _ref5, relatedConsoleAppId, currentConfig, _ALIYUN_CONSOLE_CONFI, mainDomain, res, _t3;
|
|
104
104
|
return _regenerator.default.wrap(function (_context2) {
|
|
105
105
|
while (1) switch (_context2.prev = _context2.next) {
|
|
106
106
|
case 0:
|
|
@@ -124,8 +124,11 @@ var getConfigV2 = exports.getConfigV2 = /*#__PURE__*/function () {
|
|
|
124
124
|
return _context2.abrupt("return", currentConfig);
|
|
125
125
|
case 2:
|
|
126
126
|
_context2.prev = 2;
|
|
127
|
+
// 内网域名(如 aliyun-inc.com / alibaba-inc.com)的 fecs 服务实际部署在去掉 `-inc` 的公网域名上,
|
|
128
|
+
// 这里剥离一级域名结尾的 `-inc` 后缀,确保 fecs 请求命中正确域名
|
|
129
|
+
mainDomain = (0, _consoleBaseConfParseEnv.default)().MAIN_DOMAIN.replace(/-inc(?=\.[^.]+$)/, '');
|
|
127
130
|
_context2.next = 3;
|
|
128
|
-
return _request.default.get("https://".concat(config.env !== 'prod' ? 'pre-' : '', "fecs.console.").concat(
|
|
131
|
+
return _request.default.get("https://".concat(config.env !== 'prod' ? 'pre-' : '', "fecs.console.").concat(mainDomain, "/api/alfa/console/config?appId=").concat(relatedConsoleAppId), {
|
|
129
132
|
withCredentials: true
|
|
130
133
|
});
|
|
131
134
|
case 3:
|