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