url: Api.TakeOut,
method: ‘get’
})
}
登录接口数据
{‘code’: 200, ‘data’: {‘token’: ‘X-admin’}, ‘message’: “操作成功”}
退出接口数据
{‘code’: 200, ‘data’: ‘success’, ‘message’: “操作成功”}
详情接口数据
{
“code”: 200,
“data”: {
“avatar”: “https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif”,
“name”: “黄晓果”,
“roles”: [
“editor”
]
}
}
- 改造router/index.js
import Vue from ‘vue’
import Router from ‘vue-router’
Vue.use(Router)
/* Layout */
import Layout from ‘@/layout’
// 基础路由
export const constantRoutes = [
{
path: ‘/login’,
component: () => import(‘@/views/login/index’),
hidden: true
},
{
path: ‘/404’,
component: () => import(‘@/views/404’),
hidden: true
},
{
path: ‘/’,
component: Layout,
redirect: ‘/dashboard’,
children: [{
path: ‘dashboard’,
name: ‘Dashboard’,
component: () => import(‘@/views/dashboard/index’),
meta: { title: ‘首页’, icon: ‘el-icon-menu’ }
}]
},
]
/**
- 动态路由
*/
export const asyncRoutes = [
{
path: ‘/studentinformation’,
component: Layout,
children: [
{
path: ‘index’,
component: () => import(‘@/views/studentinformation/index’),
meta: { title: ‘学生信息’, icon: ‘el-icon-s-check’ }
}
]
},
{
path: ‘/lecturerinformation’,
component: Layout,
children: [
{
path: ‘index’,
component: () => import(‘@/views/lecturerinformation/index’),
meta: { title: ‘讲师信息’, icon: ‘el-icon-s-custom’, roles: [‘editor’] }
}
]
},
{
path: ‘/coursemanage’,
component: Layout,
meta: { roles: [‘admin’] },
children: [
{
path: ‘index’,
component: () => import(‘@/views/course