|
|
@@ -49,7 +49,13 @@ async function handleTokenExpiry() {
|
|
|
// 跳转到首页(在会话存储中标记需要显示登录框)
|
|
|
try {
|
|
|
sessionStorage.setItem('NEED_LOGIN_MODAL', '1');
|
|
|
- window.location.href = '/'
|
|
|
+ // 在Electron环境中使用正确的协议
|
|
|
+ if (window.location.protocol === 'file:') {
|
|
|
+ window.location.href = window.location.href.split('#')[0] + '#/';
|
|
|
+ window.location.reload()
|
|
|
+ } else {
|
|
|
+ window.location.href = '/';
|
|
|
+ }
|
|
|
console.log('Token失效:已跳转到首页');
|
|
|
} catch (error) {
|
|
|
console.error('Token失效:跳转到首页失败:', error);
|