Merge branch 'dev-3.6' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.7
This commit is contained in:
@@ -177,10 +177,14 @@ export default {
|
||||
this.getHistory()
|
||||
}, 100),
|
||||
logout () {
|
||||
this.$get('logout').then(() => {
|
||||
this.logoutSuccess()
|
||||
window.open('', window.opener.name)
|
||||
})
|
||||
window.open('', window.opener.name)
|
||||
const opener = window.opener
|
||||
opener.postMessage(
|
||||
JSON.stringify({
|
||||
close: true,
|
||||
isLogout: true
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { post, get } from '@/http'
|
||||
const terminalFile = {
|
||||
state: {
|
||||
fileList: [],
|
||||
@@ -23,6 +24,7 @@ const terminalFile = {
|
||||
},
|
||||
setExternalTerminal (state, item) { // 第一次 关闭或者打开 termail
|
||||
state.externalTerminal = !state.externalTerminal
|
||||
let self = this
|
||||
if (!state.messageFunction) {
|
||||
state.messageFunction = true
|
||||
window.addEventListener('message', function (e) {
|
||||
@@ -31,6 +33,13 @@ const terminalFile = {
|
||||
if (data.close) {
|
||||
state.externalTerminal = false
|
||||
}
|
||||
if (data.isLogout) {
|
||||
console.log(state, self)
|
||||
get('logout').then(() => {
|
||||
self.commit('logoutSuccess')
|
||||
document.location.href = '/'
|
||||
})
|
||||
}
|
||||
} catch (error) {}
|
||||
})
|
||||
window.addEventListener('unload', () => {
|
||||
|
||||
Reference in New Issue
Block a user