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.
- package/dist/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/GroupTip.d.ts +1 -0
- package/es/utils/modal.js +6 -5
- package/lib/components/GroupTip.d.ts +1 -0
- package/lib/utils/modal.js +6 -5
- package/package.json +1 -1
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
|
-
|
|
193
|
-
|
|
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
|
-
|
|
201
|
-
|
|
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/lib/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
|
-
|
|
193
|
-
|
|
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
|
-
|
|
201
|
-
|
|
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
|
};
|