Skip to content

Commit

Permalink
Merge pull request #2975 from hLinx/hotfix_3.8.x
Browse files Browse the repository at this point in the history
feat: 登录小窗修改为使用window.open #2973
  • Loading branch information
hLinx authored May 13, 2024
2 parents cf23fa7 + 37b75c3 commit 99d15db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"license": "ISC",
"dependencies": {
"@blueking/ip-selector": "0.3.0-beta.21",
"@blueking/login-modal": "1.0.4",
"@blueking/notice-component-vue2": "2.0.0-beta.2",
"@blueking/paas-login": "0.0.11",
"@blueking/sub-saas": "0.0.0-beta.6",
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/src/utils/request/middleware/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import AuthResultModel from '@model/auth-result';

import EventBus from '@utils/event-bus';
import { showLoginModal } from '@blueking/login-modal'

import {
loginDialog,
messageError,
permissionDialog,
systemPermission,
Expand Down Expand Up @@ -93,7 +93,9 @@ export default (interceptors) => {
// 未登录
case 401:
if (hasLogined) {
loginDialog(error.message);
showLoginModal({
loginUrl: `${error.message}&c_url=${decodeURIComponent(`${window.location.origin}/static/login_success.html`)}`
})
} else {
window.location.href = `${error.message}&c_url=${decodeURIComponent(window.location.href)}`;
}
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/static/login_success.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
</head>
<script>
window.name = 'job'
window.parent.location.reload()
window.opener && window.opener.location.reload()
window.close()
</script>

<body style="font-family: Microsoft Yahei;">
Expand Down

0 comments on commit 99d15db

Please sign in to comment.