Skip to content

Commit 7cdb8ee

Browse files
authored
Merge pull request #78 from zhoumengkang/master
解决 chrome 打开新窗口被拦截的问题
2 parents 4c37a7e + 400e0bb commit 7cdb8ee

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

assets/bootstrap/js/httpclient/httpclient.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ function AjaxError(response) {
4444
let errCode = response.status;
4545
let errMsg = response.responseText;
4646

47-
if (errCode === 401) { // 跳转到登录页
48-
// 关闭当前界面
49-
parent.window.close();
50-
window.open("/login");
47+
if (errCode === 401) {
48+
// 跳转到登录页
49+
if (window.frames.length !== parent.frames.length) {
50+
parent.window.open("/login",'_self');
51+
}else{
52+
window.open("/login",'_self');
53+
}
5154
return;
5255
}
5356

0 commit comments

Comments
 (0)