ls-pro-common 3.1.11 → 3.1.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.
@@ -5,6 +5,7 @@ export declare type GroupTitleProps = {
5
5
  className?: string;
6
6
  style?: React.CSSProperties;
7
7
  isInner?: boolean;
8
+ children?: React.ReactNode;
8
9
  };
9
10
  declare const GroupTip: React.FC<GroupTitleProps>;
10
11
  export default GroupTip;
package/es/utils/modal.js CHANGED
@@ -182,23 +182,24 @@ export var showConfirm = function showConfirm(text) {
182
182
  });
183
183
  });
184
184
  };
185
- var timeout = false;
186
185
  /**
187
186
  * Token过期重新登录
188
187
  *
189
188
  * @returns
190
189
  */
191
190
  export var reLogin = function reLogin() {
192
- if (timeout) return;
193
- timeout = true;
191
+ // 如果已经显示过,则不再显示
192
+ if (sessionStorage.getItem('reLogin') === '1') return;
193
+ sessionStorage.setItem('reLogin', '1');
194
194
  _Modal.warning({
195
195
  title: '登录状态已过期,请重新登录',
196
196
  okText: '重新登录',
197
197
  maskClosable: false,
198
198
  getContainer: getFullScreenElement() || document.body,
199
199
  afterClose: function afterClose() {
200
- timeout = false;
201
- (window.top || window).location.href = location.pathname === '/' ? '/login/' : '/login/?redirect=' + encodeURIComponent(location.href);
200
+ sessionStorage.removeItem('reLogin');
201
+ var win = window.top || window; // 获取顶层窗口,防止iframe加载子工程页面
202
+ win.location.href = location.pathname === '/' ? '/login/' : '/login/?redirect=' + encodeURIComponent(win.location.href);
202
203
  }
203
204
  });
204
205
  };
@@ -5,6 +5,7 @@ export declare type GroupTitleProps = {
5
5
  className?: string;
6
6
  style?: React.CSSProperties;
7
7
  isInner?: boolean;
8
+ children?: React.ReactNode;
8
9
  };
9
10
  declare const GroupTip: React.FC<GroupTitleProps>;
10
11
  export default GroupTip;
@@ -182,23 +182,24 @@ export var showConfirm = function showConfirm(text) {
182
182
  });
183
183
  });
184
184
  };
185
- var timeout = false;
186
185
  /**
187
186
  * Token过期重新登录
188
187
  *
189
188
  * @returns
190
189
  */
191
190
  export var reLogin = function reLogin() {
192
- if (timeout) return;
193
- timeout = true;
191
+ // 如果已经显示过,则不再显示
192
+ if (sessionStorage.getItem('reLogin') === '1') return;
193
+ sessionStorage.setItem('reLogin', '1');
194
194
  _Modal.warning({
195
195
  title: '登录状态已过期,请重新登录',
196
196
  okText: '重新登录',
197
197
  maskClosable: false,
198
198
  getContainer: getFullScreenElement() || document.body,
199
199
  afterClose: function afterClose() {
200
- timeout = false;
201
- (window.top || window).location.href = location.pathname === '/' ? '/login/' : '/login/?redirect=' + encodeURIComponent(location.href);
200
+ sessionStorage.removeItem('reLogin');
201
+ var win = window.top || window; // 获取顶层窗口,防止iframe加载子工程页面
202
+ win.location.href = location.pathname === '/' ? '/login/' : '/login/?redirect=' + encodeURIComponent(win.location.href);
202
203
  }
203
204
  });
204
205
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.11",
3
+ "version": "3.1.12",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [