新增加路由器前缀通过环境变量配置
This commit is contained in:
@@ -88,7 +88,7 @@ export default {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$store.dispatch("LogOut").then(() => {
|
||||
location.href = "/index";
|
||||
location.href = process.env.VUE_APP_ROUTER_PREFIX + "index";
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@@ -109,8 +109,8 @@ export const constantRoutes = [
|
||||
]
|
||||
|
||||
export default new Router({
|
||||
base: process.env.VUE_APP_ROUTER_PREFIX,
|
||||
mode: 'history', // 去掉url中的#
|
||||
// base: '',
|
||||
// scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRoutes
|
||||
})
|
||||
|
||||
@@ -54,7 +54,7 @@ service.interceptors.response.use(res => {
|
||||
}
|
||||
).then(() => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = '/index';
|
||||
location.href = process.env.VUE_APP_ROUTER_PREFIX + '/index';
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user