Commit 2ea0ddae by 姜雷

添加基本地址配置

parent 8901c98b
import 'normalize.css/normalize.css';
import App from '../App';
import router, { constantRouterMap, routeStore } from '../router';
import { constantRouterMap, routeStore } from '../router';
import store from '../store';
import createBaseFetch from './Api';
import configRoutePermission from './permission';
......@@ -25,11 +25,18 @@ class SystemShell {
this.mixinModule = mixinModule;
this.utils = utilsModule;
}
createSystem = ({ routers, routeFilter }) => {
createSystem = ({ basePath = '/', routers, routeFilter }) => {
const router = new VueRouter({
mode: 'history',
base: basePath,
scrollBehavior: () => ({ y: 0 }),
routes: constantRouterMap,
});
routeStore.install(store);
extendCom(Vue);
configRoutePermission(router, store, routers);
Vue.config.productionTip = false;
console.log(router);
let app = new Vue({
el: '#app',
......
......@@ -9,5 +9,6 @@ let allAasyncRouterMap = [
];
System.createSystem({
basePath: process.env.VUE_APP_BASE_URL,
routers: allAasyncRouterMap,
});
......@@ -33,9 +33,8 @@ const asyncRouterMap = [{ path: '*', redirect: '/404', hidden: true }];
export { constantRouterMap, asyncRouterMap, routeStore };
export default new VueRouter({
mode: 'history',
base: process.env.VUE_APP_BASE_URL,
scrollBehavior: () => ({ y: 0 }),
routes: constantRouterMap,
});
export default {
constantRouterMap,
asyncRouterMap,
routeStore,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment