新增跳转时打开新窗口功能

This commit is contained in:
2026-07-24 18:19:33 +08:00
parent 0e88255852
commit f3bdb07e3d
22 changed files with 132 additions and 46 deletions
+3 -3
View File
@@ -173,7 +173,7 @@ const ApiClient = {
if (!response.ok) {
if (response.status === 401) {
localStorage.removeItem('token');
window.location.href = 'login.html';
NavigationUtil.open('login.html');
}
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
@@ -331,10 +331,10 @@ const ApiClient = {
if (/\/(login|reg|repwd)\.html$/i.test(path)) return;
const returnUrl = window.location.pathname + window.location.search;
const loginPath = '/login.html?redirect=' + encodeURIComponent(returnUrl);
window.location.href =
NavigationUtil.open(
typeof CommonUtil !== 'undefined' && CommonUtil.siteHref
? CommonUtil.siteHref(loginPath)
: ((window.CURRENT_ENV === 'development' ? '/html/login.html?redirect=' : '/login.html?redirect=') + encodeURIComponent(returnUrl));
: ((window.CURRENT_ENV === 'development' ? '/html/login.html?redirect=' : '/login.html?redirect=') + encodeURIComponent(returnUrl)));
},
buildUrl(url, params) {