入驻跳转后台路由创建

This commit is contained in:
熊丽君
2022-02-10 09:54:44 +08:00
parent 3dfddfc2de
commit cecaaf1616
6 changed files with 59 additions and 8 deletions

View File

@ -166,14 +166,40 @@ export const constantRoutes = [
] ]
}, },
{ {
path: '/admin', path: '/one',
component: Layout, component: Layout,
redirect: 'index', redirect: '/one/enterprise',
children: [ children: [
{ {
path: 'index', path: 'enterprise',
component: () => import('@/views/index'), component: () => import('@/views/admin/one/index'),
name: 'Index', name: 'Enterprise',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
{
path: '/two',
component: Layout,
redirect: '/two/expert',
children: [
{
path: 'expert',
component: () => import('@/views/admin/two/index'),
name: 'Expert',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
{
path: '/three',
component: Layout,
redirect: '/three/expert',
children: [
{
path: 'expert',
component: () => import('@/views/admin/three/index'),
name: 'Expert',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: '首页', icon: 'dashboard', affix: true }
} }
] ]

View File

@ -1,6 +1,6 @@
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token' const TokenKey = 'Cas-Token'
export function getToken() { export function getToken() {
return Cookies.get(TokenKey) return Cookies.get(TokenKey)

View File

@ -0,0 +1,3 @@
<template>
<div>index</div>
</template>

View File

@ -0,0 +1,3 @@
<template>
<div>index3</div>
</template>

View File

@ -0,0 +1,3 @@
<template>
<div>index2</div>
</template>

View File

@ -104,7 +104,23 @@ function handleStatus(item) {
} }
} }
function handlePage(item) { function handlePage(item) {
console.log(item); let routeData = "";
alert("进入后台"); if (item.id == 1) {
// 企业
routeData = router.resolve({ path: "/one" });
} else if (item.id == 2) {
// 专家
routeData = router.resolve({ path: "/two" });
} else if (item.id == 4) {
// 研究机构
routeData = router.resolve({ path: "/three" });
} else if (item.id == 8) {
// 实验室
routeData = router.resolve({ path: "/four" });
} else if (item.id == 16) {
// 科技经纪人
routeData = router.resolve({ path: "/five" });
}
window.open(routeData.href, "_blank");
} }
</script> </script>