接收登出消息根据token 判断是否登出
This commit is contained in:
parent
bc47132b21
commit
a01ffd71d0
@ -41,6 +41,7 @@ export default {
|
||||
}
|
||||
},
|
||||
'$store.state.socket.beLogoutCount': async function(val) {
|
||||
if (this.$store.state.socket.loggedOutMsg.token === getToken()) {
|
||||
this.$store.dispatch('disconnect').then(()=>{
|
||||
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
@ -51,6 +52,8 @@ export default {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'$store.state.app.transitionAnimationsCount': function(val) {
|
||||
this.loading = true;
|
||||
|
@ -135,6 +135,7 @@ function handle(state, data) {
|
||||
break;
|
||||
case 'Be_Logged_Out': // 重复登录被登出
|
||||
state.beLogoutCount++;
|
||||
state.loggedOutMsg = msg;
|
||||
break;
|
||||
case 'Simulation_Run_Plan_Reload': // 运行图变更
|
||||
state.runPlanReloadCount++;
|
||||
@ -342,7 +343,8 @@ const socket = {
|
||||
simulationSpeed: 1, // 仿真倍速
|
||||
simulationPause: false,
|
||||
simulationPslStatus: [], // PSL面板按钮状态信息
|
||||
simulationPlanChange:{} // 运行图加线/抽线/变化推送消息
|
||||
simulationPlanChange:{}, // 运行图加线/抽线/变化推送消息
|
||||
loggedOutMsg: ''
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user