追加全局方法跳转使其能在同一页面跳转不受影响
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -8,7 +8,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
this.initConfig()
|
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
this.initWaterMarker()
|
this.initWaterMarker()
|
||||||
@@ -21,18 +20,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['initWaterMarker', 'logout', 'getConfig']),
|
...mapMutations(['initWaterMarker', 'logout', 'getConfig']),
|
||||||
initDev() {
|
goto(params) {
|
||||||
let baseURL = 'http://192.168.1.87:9000'
|
let {path} = this.$route
|
||||||
this.getConfig({baseURL})
|
this.$router.push({path, ...params})
|
||||||
},
|
|
||||||
initConfig() {
|
|
||||||
if (process.env.NODE_ENV == 'development') this.initDev()
|
|
||||||
else {
|
|
||||||
let baseURL = location.origin
|
|
||||||
this.getConfig({baseURL})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user