@bit-sun/business-component 2.4.28 → 2.4.29

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/index.esm.js CHANGED
@@ -524,12 +524,11 @@ function _objectDestructuringEmpty(obj) {
524
524
  function _objectWithoutPropertiesLoose(source, excluded) {
525
525
  if (source == null) return {};
526
526
  var target = {};
527
- var sourceKeys = Object.keys(source);
528
- var key, i;
529
- for (i = 0; i < sourceKeys.length; i++) {
530
- key = sourceKeys[i];
531
- if (excluded.indexOf(key) >= 0) continue;
532
- target[key] = source[key];
527
+ for (var key in source) {
528
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
529
+ if (excluded.indexOf(key) >= 0) continue;
530
+ target[key] = source[key];
531
+ }
533
532
  }
534
533
  return target;
535
534
  }
@@ -713,10 +712,11 @@ var getMenuAuthDataKey = function getMenuAuthDataKey(channel) {
713
712
  // 传入channel 则使用传入的channel 作为前缀,一般存储key使用
714
713
  // 否则使用下面页面路径处理后的变量为前缀,一般获取key使用
715
714
  if (!channel) {
716
- var channelPlat = window.location.pathname;
715
+ var _window$top, _window$top$location;
716
+ var channelPlat = (_window$top = window.top) === null || _window$top === void 0 ? void 0 : (_window$top$location = _window$top.location) === null || _window$top$location === void 0 ? void 0 : _window$top$location.pathname;
717
717
  var defaultPrefix = 'CONFIG_PC';
718
718
  var mapping = ENUM.MAIN_AUTH_MAPPING;
719
- prefix = (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
719
+ prefix = channelPlat && (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
720
720
  }
721
721
  return "".concat(prefix, ":").concat(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES);
722
722
  };
package/dist/index.js CHANGED
@@ -544,12 +544,11 @@ function _objectDestructuringEmpty(obj) {
544
544
  function _objectWithoutPropertiesLoose(source, excluded) {
545
545
  if (source == null) return {};
546
546
  var target = {};
547
- var sourceKeys = Object.keys(source);
548
- var key, i;
549
- for (i = 0; i < sourceKeys.length; i++) {
550
- key = sourceKeys[i];
551
- if (excluded.indexOf(key) >= 0) continue;
552
- target[key] = source[key];
547
+ for (var key in source) {
548
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
549
+ if (excluded.indexOf(key) >= 0) continue;
550
+ target[key] = source[key];
551
+ }
553
552
  }
554
553
  return target;
555
554
  }
@@ -733,10 +732,11 @@ var getMenuAuthDataKey = function getMenuAuthDataKey(channel) {
733
732
  // 传入channel 则使用传入的channel 作为前缀,一般存储key使用
734
733
  // 否则使用下面页面路径处理后的变量为前缀,一般获取key使用
735
734
  if (!channel) {
736
- var channelPlat = window.location.pathname;
735
+ var _window$top, _window$top$location;
736
+ var channelPlat = (_window$top = window.top) === null || _window$top === void 0 ? void 0 : (_window$top$location = _window$top.location) === null || _window$top$location === void 0 ? void 0 : _window$top$location.pathname;
737
737
  var defaultPrefix = 'CONFIG_PC';
738
738
  var mapping = ENUM.MAIN_AUTH_MAPPING;
739
- prefix = (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
739
+ prefix = channelPlat && (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
740
740
  }
741
741
  return "".concat(prefix, ":").concat(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES);
742
742
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.4.28",
3
+ "version": "2.4.29",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -101,10 +101,10 @@ export const getMenuAuthDataKey = (channel?: string) => {
101
101
  // 传入channel 则使用传入的channel 作为前缀,一般存储key使用
102
102
  // 否则使用下面页面路径处理后的变量为前缀,一般获取key使用
103
103
  if(!channel) {
104
- const channelPlat: string = window.location.pathname
104
+ const channelPlat: string | undefined = window.top?.location?.pathname
105
105
  const defaultPrefix = 'CONFIG_PC';
106
106
  const mapping: any = ENUM.MAIN_AUTH_MAPPING;
107
- prefix = mapping?.[channelPlat] || defaultPrefix
107
+ prefix = channelPlat && mapping?.[channelPlat] || defaultPrefix
108
108
  }
109
109
 
110
110
  return `${prefix}:${ENUM.BROWSER_CACHE.MAIN_AUTH_CODES}`