新增跳转时打开新窗口功能
This commit is contained in:
+3
-3
@@ -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) {
|
||||
|
||||
+3
-3
@@ -110,7 +110,7 @@ const CommonUtil = {
|
||||
{ btn: ['去登录', '取消'] },
|
||||
function (index) {
|
||||
layui.layer.close(index);
|
||||
window.location.href = 'login.html';
|
||||
NavigationUtil.open('login.html');
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -1178,7 +1178,7 @@ const CommonUtil = {
|
||||
}
|
||||
const authUrl = this.extractWechatAuthUrl(res);
|
||||
if (!authUrl) throw new Error('后端未返回微信授权地址');
|
||||
window.location.href = authUrl;
|
||||
NavigationUtil.open(authUrl);
|
||||
})
|
||||
.catch((error) => {
|
||||
const message = error.message || '微信登录暂不可用,请稍后再试';
|
||||
@@ -1325,7 +1325,7 @@ const CommonUtil = {
|
||||
}
|
||||
const authUrl = this.extractWechatAuthUrl(res);
|
||||
if (!authUrl) throw new Error('后端未返回微信授权地址');
|
||||
window.location.href = authUrl;
|
||||
NavigationUtil.open(authUrl);
|
||||
})
|
||||
.catch((error) => {
|
||||
const message = error.message || '微信绑定暂不可用,请稍后再试';
|
||||
|
||||
Reference in New Issue
Block a user