fix: 修改 通过父标签打开的terminal 会被取消的问题

This commit is contained in:
zhangyu
2023-01-12 09:36:55 +08:00
parent 51e1282286
commit a18f1afc3c
4 changed files with 12 additions and 6 deletions

View File

@@ -163,7 +163,7 @@
font-family: Roboto-Regular;
}
.my-loading-box{
background: #1a1a1a;
//background: #1a1a1a;
}
.nz-icon:hover{
color: $--color-primary;

View File

@@ -94,7 +94,7 @@ export default {
const data = JSON.parse(e.data)
self.$get('asset/asset/' + data.id).then(res => {
const asset = res.data
self.$refs.websshNew.addConsole(asset.id, asset.manageIp, '', '', 'asset', asset)
self.$refs.websshNew.addConsole(asset.id, asset.manageIp, '', '', 'asset', asset, 'father')
})
} catch (e) {
console.log(e)

View File

@@ -575,9 +575,13 @@ export default {
authProtocol: 1
}
this.prevent_opt.save = false
requestsArr.forEach(xhr => xhr.cancel('cancel'))
requestsArr.forEach(xhr => {
if (!xhr.parentWindow) {
xhr.cancel('cancel')
}
})
},
addConsole (id, host, accountId, port, type, asset) {
addConsole (id, host, accountId, port, type, asset, father) {
if (!id) { id = '' }
if (!host) { host = '' }
if (!accountId) { accountId = '' }
@@ -645,7 +649,8 @@ export default {
authPin: this.$loadsh.get(terminal, 'custom.authPin', ''),
authPriKey: this.$loadsh.get(terminal, 'custom.authPriKey', ''),
authUserTip: this.$loadsh.get(terminal, 'custom.authUserTip', ''),
authPinTip: this.$loadsh.get(terminal, 'custom.authPinTip', '')
authPinTip: this.$loadsh.get(terminal, 'custom.authPinTip', ''),
parentWindow: !!father
}
this.$post('/terminal/login', params).then(res => {
if (res.code == 200) {

View File

@@ -24,7 +24,8 @@ axios.interceptors.request.use(
config.id = id
requestsArr.push({
id,
cancel: source.cancel
cancel: source.cancel,
params: config.data
}) // 将该实例添加到队列中
}
const token = localStorage.getItem('nz-token')