@alicloud/alfa-core 1.5.12-beta.2 → 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.
@@ -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(parseEnv().MAIN_DOMAIN, "/api/alfa/console/config?appId=").concat(relatedConsoleAppId), {
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:
@@ -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((0, _consoleBaseConfParseEnv.default)().MAIN_DOMAIN, "/api/alfa/console/config?appId=").concat(relatedConsoleAppId), {
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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-core",
3
- "version": "1.5.12-beta.2",
3
+ "version": "1.5.13-beta.1",
4
4
  "description": "MicroFront End SDK for alicloud",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -33,7 +33,7 @@
33
33
  "crypto-js": "^4.1.1",
34
34
  "qs": "^6.14.0",
35
35
  "tslib": "^2.4.0",
36
- "@alicloud/console-os-kernal": "^1.4.40-beta.2"
36
+ "@alicloud/console-os-kernal": "^1.4.40"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "npm run babel && npm run babel:esm && npm run types",