忘了写到哪了
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { createWebHistory, createRouter } from 'vue-router'
|
||||
import { createWebHistory, createRouter } from "vue-router";
|
||||
/* Layout */
|
||||
import Layout from '@/layout'
|
||||
import Layout from "@/layout";
|
||||
import basicInfo from "../views/admin/enterprise/account/basicInfo.vue";
|
||||
|
||||
/**
|
||||
* Note: 路由配置项
|
||||
@ -27,147 +28,502 @@ import Layout from '@/layout'
|
||||
// 公共路由
|
||||
export const constantRoutes = [
|
||||
{
|
||||
path: '/redirect',
|
||||
path: "/",
|
||||
name: "Home",
|
||||
component: () => import("../views/website/website-layout.vue"),
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: "login",
|
||||
name: "login",
|
||||
component: () => import("@/views/website/login/index.vue"),
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
component: () => import("../views/website/home/index.vue"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/redirect",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: () => import('@/views/redirect/index.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/login'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
component: () => import('@/views/register'),
|
||||
hidden: true
|
||||
path: "/redirect/:path(.*)",
|
||||
component: () => import("@/views/redirect/index.vue"),
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// path: "/login",
|
||||
// component: () => import("@/views/login"),
|
||||
// hidden: true,
|
||||
// },
|
||||
// {
|
||||
// path: "/register",
|
||||
// component: () => import("@/views/register"),
|
||||
// hidden: true,
|
||||
// },
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
component: () => import('@/views/error/404'),
|
||||
hidden: true
|
||||
component: () => import("@/views/error/404"),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: () => import('@/views/error/401'),
|
||||
hidden: true
|
||||
path: "/401",
|
||||
component: () => import("@/views/error/401"),
|
||||
hidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: '/index',
|
||||
path: "/identity",
|
||||
component: () => import("@/views/identity/layout"),
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
path: "index",
|
||||
component: () => import("@/views/identity/index"),
|
||||
name: "index",
|
||||
meta: { title: "身份选择" },
|
||||
},
|
||||
{
|
||||
path: "enterprise",
|
||||
component: () => import("@/views/identity/enterprise"),
|
||||
name: "enterprise",
|
||||
meta: { title: "企业入驻" },
|
||||
},
|
||||
// {
|
||||
// path:'expert',
|
||||
// component: () => import('@/views/identity/expert'),
|
||||
// name: 'expert',
|
||||
// meta: { title: '专家入驻'}
|
||||
// },
|
||||
// {
|
||||
// path:'research',
|
||||
// component: () => import('@/views/identity/research'),
|
||||
// name: 'research',
|
||||
// meta: { title: '研究机构入驻'}
|
||||
// },
|
||||
// {
|
||||
// path:'laboratory',
|
||||
// component: () => import('@/views/identity/laboratory'),
|
||||
// name: 'laboratory',
|
||||
// meta: { title: '实验室入驻'}
|
||||
// },
|
||||
// {
|
||||
// path:'agent',
|
||||
// component: () => import('@/views/identity/agent'),
|
||||
// name: 'agent',
|
||||
// meta: { title: '科技经纪人入驻'}
|
||||
// }
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
path: "/admin",
|
||||
component: Layout,
|
||||
redirect: "/admin/index",
|
||||
children: [
|
||||
{
|
||||
path: "index",
|
||||
component: () => import("@/views/admin/index"),
|
||||
name: "Index",
|
||||
meta: { title: "首页", icon: "dashboard", affix: true },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
// {
|
||||
// path: '',
|
||||
// component: Layout,
|
||||
// redirect: '/index',
|
||||
// children: [
|
||||
// {
|
||||
// path: '/index',
|
||||
// component: () => import('@/views/index'),
|
||||
// name: 'Index',
|
||||
// meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: "/user",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
redirect: "noredirect",
|
||||
children: [
|
||||
{
|
||||
path: 'profile',
|
||||
component: () => import('@/views/system/user/profile/index'),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
path: "profile",
|
||||
component: () => import("@/views/system/user/profile/index"),
|
||||
name: "Profile",
|
||||
meta: { title: "个人中心", icon: "user" },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// 企业后台路由表
|
||||
export const enterpriseRoutes = [
|
||||
{
|
||||
path: "/account",
|
||||
component: Layout,
|
||||
meta: { title: "账号管理", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
redirect: "/account/basicInfo",
|
||||
children: [
|
||||
{
|
||||
path: "basicInfo",
|
||||
component: basicInfo,
|
||||
name: "basicInfo",
|
||||
meta: { title: "基本资料", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "bill",
|
||||
component: () => import("@/views/admin/enterprise/account/bill"),
|
||||
name: "Bill",
|
||||
meta: { title: "账单列表", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "record",
|
||||
component: () => import("@/views/admin/enterprise/account/record"),
|
||||
name: "Record",
|
||||
meta: { title: "创新币兑换记录", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/extension",
|
||||
component: Layout,
|
||||
meta: { title: "产品推广", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
redirect: "/extension/product",
|
||||
children: [
|
||||
{
|
||||
path: "product",
|
||||
component: () => import("@/views/admin/enterprise/extension/product"),
|
||||
name: "Product",
|
||||
meta: { title: "产品列表", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "release",
|
||||
component: () => import("@/views/admin/enterprise/extension/release"),
|
||||
hidden: true,
|
||||
name: "Release",
|
||||
meta: { title: "发布产品", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "results",
|
||||
component: () => import("@/views/admin/enterprise/extension/results"),
|
||||
hidden: true,
|
||||
name: "Results",
|
||||
meta: { title: "匹配结果", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "business",
|
||||
component: () => import("@/views/admin/enterprise/extension/business"),
|
||||
hidden: true,
|
||||
name: "Business",
|
||||
meta: { title: "浏览信息", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/demand",
|
||||
component: Layout,
|
||||
meta: { title: "需求管理", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
redirect: "/demand/serviceDemand",
|
||||
children: [
|
||||
{
|
||||
path: "serviceDemand",
|
||||
component: () =>
|
||||
import("@/views/admin/enterprise/demand/serviceDemand"),
|
||||
name: "serviceDemand",
|
||||
meta: { title: "服务需求", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "release",
|
||||
component: () => import("@/views/admin/enterprise/demand/release"),
|
||||
hidden: true,
|
||||
name: "release",
|
||||
meta: { title: "发布服务需求", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "technology",
|
||||
component: () => import("@/views/admin/enterprise/demand/technology"),
|
||||
name: "technology",
|
||||
meta: { title: "技术需求", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "released",
|
||||
component: () => import("@/views/admin/enterprise/demand/released"),
|
||||
hidden: true,
|
||||
name: "released",
|
||||
meta: { title: "发布技术需求", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "results",
|
||||
component: () => import("@/views/admin/enterprise/demand/results"),
|
||||
hidden: true,
|
||||
name: "results",
|
||||
meta: { title: "匹配结果", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/activity",
|
||||
component: Layout,
|
||||
meta: { title: "活动管理", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
redirect: "/activity/active",
|
||||
children: [
|
||||
{
|
||||
path: "active",
|
||||
component: () => import("@/views/admin/enterprise/activity/active"),
|
||||
name: "Active",
|
||||
meta: { title: "活动列表", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// 专家后台路由表
|
||||
export const expertRoutes = [
|
||||
{
|
||||
path: "/account",
|
||||
component: Layout,
|
||||
meta: { title: "zj账号管理", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
// redirect: 'noRedirect',
|
||||
redirect: "/account/bill",
|
||||
children: [
|
||||
{
|
||||
path: "bill",
|
||||
component: () => import("@/views/admin/expert/account/bill"),
|
||||
name: "Bill",
|
||||
meta: { title: "账单列表", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "exchange",
|
||||
component: () => import("@/views/admin/expert/account/exchange"),
|
||||
name: "Exchange",
|
||||
meta: { title: "兑换记录", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "basicInfo",
|
||||
component: () => import("@/views/admin/expert/account/basicInfo"),
|
||||
name: "basicInfo",
|
||||
meta: { title: "基本资料", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "transactionAuth",
|
||||
component: () => import("@/views/admin/expert/account/transactionAuth"),
|
||||
name: "transactionAuth",
|
||||
meta: { title: "交易认证", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "profit",
|
||||
component: () => import("@/views/admin/expert/account/profit"),
|
||||
name: "profit",
|
||||
meta: { title: "收益管理", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "withdrawal",
|
||||
component: () => import("@/views/admin/expert/account/withdrawal"),
|
||||
hidden: true,
|
||||
name: "Withdrawal",
|
||||
meta: { title: "提现记录", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/technology",
|
||||
component: Layout,
|
||||
meta: { title: "技术管理", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
redirect: "/technology/achievement",
|
||||
children: [
|
||||
{
|
||||
path: "achievement",
|
||||
component: () => import("@/views/admin/expert/technology/achievement"),
|
||||
name: "Achievement",
|
||||
meta: { title: "成果列表", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "release",
|
||||
component: () => import("@/views/admin/expert/technology/release"),
|
||||
hidden: true,
|
||||
name: "Release",
|
||||
meta: { title: "发布成果", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "results",
|
||||
component: () => import("@/views/admin/expert/technology/results"),
|
||||
hidden: true,
|
||||
name: "Results",
|
||||
meta: { title: "匹配结果", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "patent",
|
||||
component: () => import("@/views/admin/expert/technology/patent"),
|
||||
name: "patent",
|
||||
meta: { title: "专利列表", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "claimPatent",
|
||||
component: () => import("@/views/admin/expert/technology/claimPatent"),
|
||||
hidden: true,
|
||||
name: "claimPatent",
|
||||
meta: { title: "认领专利", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "paper",
|
||||
component: () => import("@/views/admin/expert/technology/paper"),
|
||||
name: "Paper",
|
||||
meta: { title: "论文列表", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "research",
|
||||
component: () => import("@/views/admin/expert/technology/research"),
|
||||
name: "Research",
|
||||
meta: { title: "科研项目列表", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/demand",
|
||||
component: Layout,
|
||||
meta: { title: "需求管理", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
redirect: "/demand/serviceDemand",
|
||||
children: [
|
||||
{
|
||||
path: "serviceDemand",
|
||||
component: () => import("@/views/admin/expert/demand/serviceDemand"),
|
||||
name: "serviceDemand",
|
||||
meta: { title: "服务需求", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "release",
|
||||
component: () => import("@/views/admin/expert/demand/release"),
|
||||
hidden: true,
|
||||
name: "release",
|
||||
meta: { title: "发布需求", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "already",
|
||||
component: () => import("@/views/admin/expert/demand/already"),
|
||||
name: "already",
|
||||
meta: { title: "已合作企业", icon: "list" },
|
||||
},
|
||||
{
|
||||
path: "think",
|
||||
component: () => import("@/views/admin/expert/demand/think"),
|
||||
name: "think",
|
||||
meta: { title: "想合作企业", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
path: "/activity",
|
||||
component: Layout,
|
||||
meta: { title: "活动管理", icon: "dashboard" },
|
||||
alwaysShow: true,
|
||||
redirect: "/activity/active",
|
||||
children: [
|
||||
{
|
||||
path: "active",
|
||||
component: () => import("@/views/admin/expert/activity/active"),
|
||||
name: "Active",
|
||||
meta: { title: "活动列表", icon: "list" },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
// 动态路由,基于用户权限动态去加载
|
||||
export const dynamicRoutes = [
|
||||
{
|
||||
path: '/system/user-auth',
|
||||
path: "/system/user-auth",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:user:edit'],
|
||||
permissions: ["system:user:edit"],
|
||||
children: [
|
||||
{
|
||||
path: 'role/:userId(\\d+)',
|
||||
component: () => import('@/views/system/user/authRole'),
|
||||
name: 'AuthRole',
|
||||
meta: { title: '分配角色', activeMenu: '/system/user' }
|
||||
}
|
||||
]
|
||||
path: "role/:userId(\\d+)",
|
||||
component: () => import("@/views/system/user/authRole"),
|
||||
name: "AuthRole",
|
||||
meta: { title: "分配角色", activeMenu: "/system/user" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/system/role-auth',
|
||||
path: "/system/role-auth",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:role:edit'],
|
||||
permissions: ["system:role:edit"],
|
||||
children: [
|
||||
{
|
||||
path: 'user/:roleId(\\d+)',
|
||||
component: () => import('@/views/system/role/authUser'),
|
||||
name: 'AuthUser',
|
||||
meta: { title: '分配用户', activeMenu: '/system/role' }
|
||||
}
|
||||
]
|
||||
path: "user/:roleId(\\d+)",
|
||||
component: () => import("@/views/system/role/authUser"),
|
||||
name: "AuthUser",
|
||||
meta: { title: "分配用户", activeMenu: "/system/role" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/system/dict-data',
|
||||
path: "/system/dict-data",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:dict:list'],
|
||||
permissions: ["system:dict:list"],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:dictId(\\d+)',
|
||||
component: () => import('@/views/system/dict/data'),
|
||||
name: 'Data',
|
||||
meta: { title: '字典数据', activeMenu: '/system/dict' }
|
||||
}
|
||||
]
|
||||
path: "index/:dictId(\\d+)",
|
||||
component: () => import("@/views/system/dict/data"),
|
||||
name: "Data",
|
||||
meta: { title: "字典数据", activeMenu: "/system/dict" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/monitor/job-log',
|
||||
path: "/monitor/job-log",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['monitor:job:list'],
|
||||
permissions: ["monitor:job:list"],
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/monitor/job/log'),
|
||||
name: 'JobLog',
|
||||
meta: { title: '调度日志', activeMenu: '/monitor/job' }
|
||||
}
|
||||
]
|
||||
path: "index",
|
||||
component: () => import("@/views/monitor/job/log"),
|
||||
name: "JobLog",
|
||||
meta: { title: "调度日志", activeMenu: "/monitor/job" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/tool/gen-edit',
|
||||
path: "/tool/gen-edit",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['tool:gen:edit'],
|
||||
permissions: ["tool:gen:edit"],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:tableId(\\d+)',
|
||||
component: () => import('@/views/tool/gen/editTable'),
|
||||
name: 'GenEdit',
|
||||
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
path: "index/:tableId(\\d+)",
|
||||
component: () => import("@/views/tool/gen/editTable"),
|
||||
name: "GenEdit",
|
||||
meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: constantRoutes,
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
return savedPosition;
|
||||
} else {
|
||||
return { top: 0 }
|
||||
return { top: 0 };
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user