@alicloud/alfa-core 1.5.6-alpha.1 → 1.5.7

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/env.js CHANGED
@@ -3,10 +3,13 @@
3
3
  * @returns
4
4
  */
5
5
  export var getEnv = function getEnv(value) {
6
- var _process, _window, _window$ALIYUN_CONSOL;
6
+ var _window, _window$ALIYUN_CONSOL;
7
7
  if (value) return value;
8
- if (((_process = process) === null || _process === void 0 ? void 0 : _process.env.NODE_ENV) === 'development') {
9
- return 'local';
8
+ if (typeof process !== 'undefined') {
9
+ var _process;
10
+ if (((_process = process) === null || _process === void 0 ? void 0 : _process.env.NODE_ENV) === 'development') {
11
+ return 'local';
12
+ }
10
13
  }
11
14
 
12
15
  // default return prod
@@ -118,7 +118,9 @@ export var getConfigV2 = /*#__PURE__*/function () {
118
118
  case 8:
119
119
  _context2.prev = 8;
120
120
  _context2.next = 11;
121
- return request.get("https://".concat(config.env !== 'prod' ? 'pre-' : '', "fecs.console.").concat(parseEnv().MAIN_DOMAIN, "/api/alfa/console/config?appId=").concat(relatedConsoleAppId));
121
+ return request.get("https://".concat(config.env !== 'prod' ? 'pre-' : '', "fecs.console.").concat(parseEnv().MAIN_DOMAIN, "/api/alfa/console/config?appId=").concat(relatedConsoleAppId), {
122
+ withCredentials: true
123
+ });
122
124
  case 11:
123
125
  res = _context2.sent;
124
126
  return _context2.abrupt("return", {
@@ -6,7 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  var whiteList = ['idptcloud01cdn.com', ((_window$ALIYUN_CONSOL = window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.MAIN_RESOURCE_CDN) || 'alicdn.com'];
7
7
  var win = window;
8
8
 
9
- // 兼容非公有云环境
9
+ // 兼容非公有云环境,用于替换请求的 hostname
10
10
  var getCurrentCdnHost = function getCurrentCdnHost() {
11
11
  try {
12
12
  var _document$currentScri;
package/lib/utils/env.js CHANGED
@@ -9,10 +9,13 @@ exports.getEnv = void 0;
9
9
  * @returns
10
10
  */
11
11
  var getEnv = exports.getEnv = function getEnv(value) {
12
- var _process, _window, _window$ALIYUN_CONSOL;
12
+ var _window, _window$ALIYUN_CONSOL;
13
13
  if (value) return value;
14
- if (((_process = process) === null || _process === void 0 ? void 0 : _process.env.NODE_ENV) === 'development') {
15
- return 'local';
14
+ if (typeof process !== 'undefined') {
15
+ var _process;
16
+ if (((_process = process) === null || _process === void 0 ? void 0 : _process.env.NODE_ENV) === 'development') {
17
+ return 'local';
18
+ }
16
19
  }
17
20
 
18
21
  // default return prod
@@ -125,7 +125,9 @@ var getConfigV2 = exports.getConfigV2 = /*#__PURE__*/function () {
125
125
  case 8:
126
126
  _context2.prev = 8;
127
127
  _context2.next = 11;
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));
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), {
129
+ withCredentials: true
130
+ });
129
131
  case 11:
130
132
  res = _context2.sent;
131
133
  return _context2.abrupt("return", {
@@ -13,7 +13,7 @@ var _window$ALIYUN_CONSOL;
13
13
  var whiteList = ['idptcloud01cdn.com', ((_window$ALIYUN_CONSOL = window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.MAIN_RESOURCE_CDN) || 'alicdn.com'];
14
14
  var win = window;
15
15
 
16
- // 兼容非公有云环境
16
+ // 兼容非公有云环境,用于替换请求的 hostname
17
17
  var getCurrentCdnHost = function getCurrentCdnHost() {
18
18
  try {
19
19
  var _document$currentScri;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-core",
3
- "version": "1.5.6-alpha.1",
3
+ "version": "1.5.7",
4
4
  "description": "MicroFront End SDK for alicloud",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -32,7 +32,7 @@
32
32
  "crypto-js": "^4.1.1",
33
33
  "qs": "^6.14.0",
34
34
  "tslib": "^2.4.0",
35
- "@alicloud/console-os-kernal": "^1.4.38-alpha.0"
35
+ "@alicloud/console-os-kernal": "^1.4.38"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "breezr build --engine webpack",