@bit-sun/business-component 3.0.0-alpha.25 → 3.0.0-alpha.26

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
@@ -514,12 +514,11 @@ function _objectDestructuringEmpty(obj) {
514
514
  function _objectWithoutPropertiesLoose(source, excluded) {
515
515
  if (source == null) return {};
516
516
  var target = {};
517
- var sourceKeys = Object.keys(source);
518
- var key, i;
519
- for (i = 0; i < sourceKeys.length; i++) {
520
- key = sourceKeys[i];
521
- if (excluded.indexOf(key) >= 0) continue;
522
- target[key] = source[key];
517
+ for (var key in source) {
518
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
519
+ if (excluded.indexOf(key) >= 0) continue;
520
+ target[key] = source[key];
521
+ }
523
522
  }
524
523
  return target;
525
524
  }
@@ -706,10 +705,11 @@ var getMenuAuthDataKey = function getMenuAuthDataKey(channel) {
706
705
  // 传入channel 则使用传入的channel 作为前缀,一般存储key使用
707
706
  // 否则使用下面页面路径处理后的变量为前缀,一般获取key使用
708
707
  if (!channel) {
709
- var channelPlat = window.location.pathname;
708
+ var _window$top, _window$top$location;
709
+ 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;
710
710
  var defaultPrefix = 'CONFIG_PC';
711
711
  var mapping = ENUM.MAIN_AUTH_MAPPING;
712
- prefix = (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
712
+ prefix = channelPlat && (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
713
713
  }
714
714
  return "".concat(prefix, ":").concat(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES);
715
715
  };
package/dist/index.js CHANGED
@@ -537,12 +537,11 @@ function _objectDestructuringEmpty(obj) {
537
537
  function _objectWithoutPropertiesLoose(source, excluded) {
538
538
  if (source == null) return {};
539
539
  var target = {};
540
- var sourceKeys = Object.keys(source);
541
- var key, i;
542
- for (i = 0; i < sourceKeys.length; i++) {
543
- key = sourceKeys[i];
544
- if (excluded.indexOf(key) >= 0) continue;
545
- target[key] = source[key];
540
+ for (var key in source) {
541
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
542
+ if (excluded.indexOf(key) >= 0) continue;
543
+ target[key] = source[key];
544
+ }
546
545
  }
547
546
  return target;
548
547
  }
@@ -729,10 +728,11 @@ var getMenuAuthDataKey = function getMenuAuthDataKey(channel) {
729
728
  // 传入channel 则使用传入的channel 作为前缀,一般存储key使用
730
729
  // 否则使用下面页面路径处理后的变量为前缀,一般获取key使用
731
730
  if (!channel) {
732
- var channelPlat = window.location.pathname;
731
+ var _window$top, _window$top$location;
732
+ 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;
733
733
  var defaultPrefix = 'CONFIG_PC';
734
734
  var mapping = ENUM.MAIN_AUTH_MAPPING;
735
- prefix = (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
735
+ prefix = channelPlat && (mapping === null || mapping === void 0 ? void 0 : mapping[channelPlat]) || defaultPrefix;
736
736
  }
737
737
  return "".concat(prefix, ":").concat(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES);
738
738
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "3.0.0-alpha.25",
3
+ "version": "3.0.0-alpha.26",
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}`