123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- import Vue from 'vue'
- import Router from 'vue-router'
- Vue.use(Router)
- import Layout from '@/layout'
- export const moreRoutes = [
- {
- path: '/base',
- component: Layout,
- redirect: '/base/dict',
- name: 'Base',
- alwaysShow: true,
- meta: { title: '基础数据', icon: 'dashboard' },
- children: [
- {
- path: 'dict',
- name: 'Dict',
- component: () => import('@/views/base/dict'),
- meta: { title: '系统字典' }
- },
- {
- path: 'dictDtl',
- name: 'DictDtl',
- hidden: true,
- component: () => import('@/views/base/dictDtl'),
- meta: { title: '系统字典详情' }
- }
- ]
- },
- {
- path: '/news',
- component: Layout,
- redirect: '/news/index',
- children: [{
- path: 'index',
- name: 'NewsIndex',
- component: () => import('@/views/news/index'),
- meta: { title: '洪楼News', icon: 'dashboard' }
- }]
- },
- {
- path: '/house',
- component: Layout,
- redirect: '/house/index',
- name: 'House',
- meta: { title: '楼盘管理', icon: 'dashboard' },
- children: [
- {
- path: 'index',
- name: 'HouseIndex',
- component: () => import('@/views/house/index'),
- meta: { title: '楼盘列表' }
- },
- {
- path: 'news',
- name: 'HouseNews',
- hidden: true,
- component: () => import('@/views/house/news'),
- meta: { title: '楼盘动态' }
- },
- {
- path: 'theme',
- name: 'HouseTheme',
- component: () => import('@/views/house/theme'),
- meta: { title: '模板主题' }
- },
- {
- path: 'comment',
- name: 'HouseComment',
- component: () => import('@/views/house/comment'),
- meta: { title: '楼盘评论' }
- },
- {
- path: 'old',
- name: 'HouseOld',
- component: () => import('@/views/house/old'),
- meta: { title: '房源管理' }
- },
- ]
- },
- {
- path: '/school',
- component: Layout,
- redirect: '/school/index',
- children: [{
- path: 'index',
- name: 'SchoolIndex',
- component: () => import('@/views/school/index'),
- meta: { title: '学校管理', icon: 'dashboard' }
- }]
- },
- {
- path: '/qa',
- component: Layout,
- redirect: '/qa/index',
- children: [{
- path: 'index',
- name: 'QaIndex',
- component: () => import('@/views/qa/index'),
- meta: { title: '问答管理', icon: 'dashboard' }
- }]
- },
- {
- path: '/tupai',
- component: Layout,
- redirect: '/tupai/index',
- children: [{
- path: 'index',
- name: 'TupaiIndex',
- component: () => import('@/views/tupai/index'),
- meta: { title: '土拍管理', icon: 'dashboard' }
- }]
- },
- {
- path: '/feedback',
- component: Layout,
- redirect: '/feedback/index',
- children: [{
- path: 'index',
- name: 'FeedbackIndex',
- component: () => import('@/views/feedback/index'),
- meta: { title: '反馈管理', icon: 'dashboard' }
- }]
- },
- {
- path: '/user',
- component: Layout,
- redirect: '/user/app',
- children: [{
- path: 'app',
- name: 'UserApp',
- component: () => import('@/views/user/app'),
- meta: { title: '用户管理', icon: 'dashboard', affix: true }
- }]
- },
- ]
- 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: 'dashboard' }
- }]
- },
- ...moreRoutes
- ]
- export const asyncRoutes = [
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { path: '*', redirect: '/404', hidden: true }
- ]
- const createRouter = () => new Router({
- mode: 'history',
- scrollBehavior: () => ({ y: 0 }),
- routes: constantRoutes
- })
- const router = createRouter()
- export function resetRouter() {
- const newRouter = createRouter()
- router.matcher = newRouter.matcher
- }
- export default router
|