入驻跳转后台路由创建
This commit is contained in:
@ -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 }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
3
src/views/admin/one/index.vue
Normal file
3
src/views/admin/one/index.vue
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<div>index</div>
|
||||||
|
</template>
|
||||||
3
src/views/admin/three/index.vue
Normal file
3
src/views/admin/three/index.vue
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<div>index3</div>
|
||||||
|
</template>
|
||||||
3
src/views/admin/two/index.vue
Normal file
3
src/views/admin/two/index.vue
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<div>index2</div>
|
||||||
|
</template>
|
||||||
@ -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>
|
||||||
Reference in New Issue
Block a user