Files
rsxm-master/src/router/index.js

70 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-08-18 16:50:57 +08:00
import { createRouter,createWebHashHistory } from "vue-router";
import store from "@/store";
// import Home from '../views/Home.vue'
/**
* 关于路由配置描述
* 1.meta && meta.title && meta.icon 则在菜单栏显示
* 2.如果存在children , 则以el-sub-menu子菜单显示
* 否则不在menu菜单显示
* 如果只展示单级别菜单 需要像developer这样配置
*/
/**
* 私有路由表
*/
export const privateRoutes = [];
/**
* 公开路由表
*/
export const publicRoutes = [
{
path: "/",
name: "/home",
component: () => import("@/views/largeScreen/index"),
meta: {},
},
2025-08-22 18:12:29 +08:00
{
path: "/recruitment",
name: "/recruitment",
component: () => import("@/views/recruitment/index"),
meta: {},
},
2025-08-18 16:50:57 +08:00
{
path: "/industry",
name: "/industry",
component: () => import("@/views/portraitScreen/index"),
meta: {},
},
{
path: "/cpp",
name: "/cpp",
component: () => import("@/views/cpp/index"),
meta: {},
},
{
path: "/mapCount",
name: "/mapCount",
component: () => import("@/views/mapCount/index"),
meta: {},
},
];
const router = createRouter({
history: createWebHashHistory(),
routes: publicRoutes
});
//初始化路由表
export function resetRouter() {
if (store.getters ?.routeReady && store.getters ?.userInfo ?.permission ?.menus) {
const menus = store.getters.userInfo.permission.menus;
menus.forEach((menu) => {
router.removeRoute(menu);
});
}
}
export default router;