diff --git a/src/App.vue b/src/App.vue index a540ee62f..a3053f9a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -89,13 +89,15 @@ export default { } }); window.addEventListener('storage', e => { - if (e.key == 'setTrainingOperate') { - const operate = JSON.parse(e.newValue); - this.$store.dispatch('trainingNew/setTrainingOperate', operate); - } - if (e.key == 'setSceneOperate') { - const operate = JSON.parse(e.newValue); - this.$store.dispatch('trainingNew/setSceneOperate', operate); + if (this.$route.path.includes('trainingDesign')) { + if (e.key == 'setTrainingOperate') { + const operate = JSON.parse(e.newValue); + this.$store.dispatch('trainingNew/setTrainingOperate', operate); + } + if (e.key == 'setSceneOperate') { + const operate = JSON.parse(e.newValue); + this.$store.dispatch('trainingNew/setSceneOperate', operate); + } } }); this.$nextTick(() => {