| | |
| | | import purchaseRouter from "./purchase/index.js" |
| | | import productRouter from "./product/index.js" |
| | | import {getMenuTreeByRole} from "@/api/menus/index" |
| | | import store from '@/store/index.js'; |
| | | |
| | | Vue.use(Router) |
| | | const login = (resolve) => require(["@/views/other/login/index"], resolve) |
| | |
| | | // 导出路由 在 main.js 里使用 |
| | | const createRouter = () => |
| | | new Router({ |
| | | mode: "history", |
| | | mode: "hash", |
| | | // base: window.getServerJson.context, |
| | | scrollBehavior: () => ({ y: 0 }), |
| | | routes: constantRoutes |
| | |
| | | }; |
| | | const foundObject = res.data.list.find(obj => obj.systemType === 4); |
| | | if (foundObject) { |
| | | // 存储进vuex |
| | | store.commit('setMenus', foundObject); |
| | | foundObject.menus.forEach(item => { |
| | | const nextPath = item.children.find(obj => obj.path === routePath); |
| | | if (nextPath) { |