src/router/index.js
@@ -6,6 +6,7 @@
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)
@@ -14,7 +15,7 @@
const productManage = (resolve) => require(["@/views/productManage/index"], resolve)
const PreviewFile = (resolve) => require(["@/views/supplierManage/supplier/PreviewFile"], resolve)
const noData = (resolve) => require(["@/views/NoData/index"], resolve)
const commonSet = (resolve) => require(["@/views/systemSet/commonSet/index"], resolve) //系統設置
export const routes = [
  // 无数据页面
@@ -55,6 +56,14 @@
    meta: {
      title: "产品管理",
      isAllways: true
    }
  },
  {
    path: "/systemSet/commonSet",
    name: "commonSet",
    component: commonSet,
    meta: {
      title: "通用设置"
    }
  }
]
@@ -118,6 +127,8 @@
    };
    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) {