@bit-sun/business-component 2.2.11 → 2.2.12

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
@@ -21069,7 +21069,8 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21069
21069
  value: function componentDidMount() {
21070
21070
  var _window$$wujie,
21071
21071
  _this2 = this,
21072
- _localStorage$getItem;
21072
+ _localStorage$getItem,
21073
+ _localStorage$getItem2;
21073
21074
  var _this$props = this.props,
21074
21075
  history = _this$props.history,
21075
21076
  location = _this$props.location,
@@ -21096,7 +21097,6 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21096
21097
  // }
21097
21098
  // });
21098
21099
  (_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.bus.$on("main-route-change", function (appname, info) {
21099
- console.log('$on main route change ----------------------------', appname, info);
21100
21100
  if (appname === itemPath) {
21101
21101
  istParent = 1;
21102
21102
  if (info.type === 'main') {
@@ -21214,10 +21214,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21214
21214
  });
21215
21215
  istParent = 0;
21216
21216
  });
21217
- if (localStorage.getItem('firstPage') && ((_localStorage$getItem = localStorage.getItem('firstPage')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("#/".concat(itemPath, "/")))) {
21218
- var _localStorage$getItem2;
21217
+ if (localStorage.getItem('mainRoutePath') && ((_localStorage$getItem = localStorage.getItem('mainRoutePath')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("/".concat(itemPath, "/")))) {
21219
21218
  istParent = 1;
21220
- history.push((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.slice(1).replace(/^\/\w+\//, '/'));
21219
+ history.push(localStorage.getItem('mainRoutePath').replace(/^\/\w+\//, '/'));
21220
+ } else if (localStorage.getItem('firstPage') && ((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.startsWith("#/".concat(itemPath, "/")))) {
21221
+ var _localStorage$getItem3;
21222
+ // 暂时保留,兼容老版本
21223
+ istParent = 1;
21224
+ history.push((_localStorage$getItem3 = localStorage.getItem('firstPage')) === null || _localStorage$getItem3 === void 0 ? void 0 : _localStorage$getItem3.slice(1).replace(/^\/\w+\//, '/'));
21221
21225
  } else {
21222
21226
  history.push(location);
21223
21227
  }
package/dist/index.js CHANGED
@@ -21087,7 +21087,8 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21087
21087
  value: function componentDidMount() {
21088
21088
  var _window$$wujie,
21089
21089
  _this2 = this,
21090
- _localStorage$getItem;
21090
+ _localStorage$getItem,
21091
+ _localStorage$getItem2;
21091
21092
  var _this$props = this.props,
21092
21093
  history = _this$props.history,
21093
21094
  location = _this$props.location,
@@ -21114,7 +21115,6 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21114
21115
  // }
21115
21116
  // });
21116
21117
  (_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.bus.$on("main-route-change", function (appname, info) {
21117
- console.log('$on main route change ----------------------------', appname, info);
21118
21118
  if (appname === itemPath) {
21119
21119
  istParent = 1;
21120
21120
  if (info.type === 'main') {
@@ -21232,10 +21232,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21232
21232
  });
21233
21233
  istParent = 0;
21234
21234
  });
21235
- if (localStorage.getItem('firstPage') && ((_localStorage$getItem = localStorage.getItem('firstPage')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("#/".concat(itemPath, "/")))) {
21236
- var _localStorage$getItem2;
21235
+ if (localStorage.getItem('mainRoutePath') && ((_localStorage$getItem = localStorage.getItem('mainRoutePath')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("/".concat(itemPath, "/")))) {
21237
21236
  istParent = 1;
21238
- history.push((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.slice(1).replace(/^\/\w+\//, '/'));
21237
+ history.push(localStorage.getItem('mainRoutePath').replace(/^\/\w+\//, '/'));
21238
+ } else if (localStorage.getItem('firstPage') && ((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.startsWith("#/".concat(itemPath, "/")))) {
21239
+ var _localStorage$getItem3;
21240
+ // 暂时保留,兼容老版本
21241
+ istParent = 1;
21242
+ history.push((_localStorage$getItem3 = localStorage.getItem('firstPage')) === null || _localStorage$getItem3 === void 0 ? void 0 : _localStorage$getItem3.slice(1).replace(/^\/\w+\//, '/'));
21239
21243
  } else {
21240
21244
  history.push(location);
21241
21245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.2.11",
3
+ "version": "2.2.12",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -360,7 +360,6 @@ class BasicLayout extends React.PureComponent {
360
360
  // });
361
361
 
362
362
  window.$wujie?.bus.$on("main-route-change", function (appname, info) {
363
- console.log('$on main route change ----------------------------', appname, info);
364
363
  if (appname === itemPath) {
365
364
  istParent = 1;
366
365
  if (info.type === 'main') {
@@ -502,10 +501,11 @@ class BasicLayout extends React.PureComponent {
502
501
  istParent = 0;
503
502
  });
504
503
 
505
- if (
506
- localStorage.getItem('firstPage') &&
507
- localStorage.getItem('firstPage')?.startsWith(`#/${itemPath}/`)
508
- ) {
504
+ if ( localStorage.getItem('mainRoutePath') && localStorage.getItem('mainRoutePath')?.startsWith(`/${itemPath}/`)) {
505
+ istParent = 1;
506
+ history.push(localStorage.getItem('mainRoutePath').replace(/^\/\w+\//, '/'))
507
+ } else if (localStorage.getItem('firstPage') && localStorage.getItem('firstPage')?.startsWith(`#/${itemPath}/`)) {
508
+ // 暂时保留,兼容老版本
509
509
  istParent = 1;
510
510
  history.push(
511
511
  localStorage