入驻跳转后台路由创建

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,
redirect: 'index',
redirect: '/one/enterprise',
children: [
{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
path: 'enterprise',
component: () => import('@/views/admin/one/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 }
}
]

View File

@ -1,6 +1,6 @@
import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'
const TokenKey = 'Cas-Token'
export function getToken() {
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) {
console.log(item);
alert("进入后台");
let routeData = "";
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>