diff --git a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js index e08a6f4ef..a6ba5529d 100644 --- a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js +++ b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js @@ -14,9 +14,6 @@ import { getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; import StompClient from '@/utils/sock'; -import { getToken } from '@/utils/auth'; -import { logout } from '@/api/login'; - var clock = new THREE.Clock(); export function Jl3ddeviceNew(dom,group,token,skinCode) { var scope = this; @@ -129,12 +126,8 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) { } if(data.type == 'Simulation_Over'){ - logout(getToken()).then(() => { - this.$store.dispatch('LogOut').then(() => { - location.reload(); - }); - }).catch(error => { - + this.$store.dispatch('LogOut').then(() => { + location.reload(); }); } diff --git a/src/jlmap3d/jl3dpassflow/connect/passflowconnect.js b/src/jlmap3d/jl3dpassflow/connect/passflowconnect.js index fc4977197..ca7663bd5 100644 --- a/src/jlmap3d/jl3dpassflow/connect/passflowconnect.js +++ b/src/jlmap3d/jl3dpassflow/connect/passflowconnect.js @@ -1,7 +1,6 @@ import StompClient from '@/utils/sock'; import { getBaseUrl } from '@/utils/baseUrl' import { getToken } from '@/utils/auth'; -import { logout } from '@/api/login'; // 定于仿真socket接口 export function PassflowConnect(jl3dpass,deviceaction,toptrain,downtrain,routegroup) { @@ -122,13 +121,9 @@ export function PassflowConnect(jl3dpass,deviceaction,toptrain,downtrain,routegr } } } - if(data.type == 'Simulation_Over'){ - logout(getToken()).then(() => { - this.$store.dispatch('LogOut').then(() => { - location.reload(); - }); - }).catch(error => { - + if(data.type == 'Simulation_Over') { + this.$store.dispatch('LogOut').then(() => { + location.reload(); }); } } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 94dd5798c..1ad306437 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -161,11 +161,13 @@ const user = { commit('CLEAR_AUTO_PARAMS'); const token = getToken(); return new Promise((resolve, reject) => { - dispatch('FedLogOut').then(resp => { - logout(token).then(() => { - resolve(); - }).catch(error => { - reject(error); + dispatch('disconnect').then(()=>{ + dispatch('FedLogOut').then(resp => { + logout(token).then(() => { + resolve(); + }).catch(error => { + reject(error); + }); }); }); }); diff --git a/src/views/jlmap3d/drive/jl3ddrive.vue b/src/views/jlmap3d/drive/jl3ddrive.vue index a2c0711e6..29ce2786f 100644 --- a/src/views/jlmap3d/drive/jl3ddrive.vue +++ b/src/views/jlmap3d/drive/jl3ddrive.vue @@ -60,8 +60,6 @@ import DriveMmi from '@/views/jlmap3d/drive/sceneview/mmiview'; import DriveTms from '@/views/jlmap3d/drive/sceneview/tmsview'; import DriveControl from '@/views/jlmap3d/drive/drivecontrol/drivecontrol'; -import { getToken } from '@/utils/auth'; -import { logout } from '@/api/login'; var train; export default { name: 'Jl3dDrive', @@ -246,12 +244,8 @@ export default { back() { if(this.$route.query.type == "DRIVE"){ - logout(getToken()).then(() => { - this.$store.dispatch('LogOut').then(() => { - location.reload(); - }); - }).catch(error => { - + this.$store.dispatch('LogOut').then(() => { + location.reload(); }); }else{ this.$emit('showdriving');