|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- import Vue from 'vue'
- import Router from 'vue-router'
- import constants from '@/utils/constants'
-
- Vue.use(Router)
-
- const router = new Router({
- // mode: 'history',
- mode: 'hash',
- routes: [{
- path: '/',
- name: 'login',
- component: () => import('@/views/login'),
- },
- {
- path: '/demo',
- name: 'demo',
- component: () => import('@/views/demo'),
- },
- {
- path:'/projdetail',
- name: 'projdetail',
- component: () => import('@/views/components_web/projDetail/projDetail')
- },
-
- {
- path: '/watch',
- name: 'watch',
- component: () => import('@/views/main_web/watchall/watchall')
- },
-
- {
- path: '/notification',
- name: 'notification',
- component: () => import('@/components/notification/notification')
- },
- {
- path:'/newproject',
- name:'newproject',
- component: ()=> import('@/views/components_web/project/newProj')
- },
- {
- path: '/watchlink',
- name: 'watchlink',
- component: () => import('@/views/main_web/watchall/watchlink')
- },
- {
- path: '/platform',
- name: 'platform',
- component: () => import('@/views/platform_center'),
- },
- {
- path: '/index',
- name: 'index',
- component: () => import('@/views/main_web/index'),
- },
- {
- path: '/projnotice',
- name: 'projnotice',
- component: () => import('@/views/main_web/projnotice'),
- },
- {
- path: '/email',
- name: 'email',
- component: () => import('@/views/components_web/head/email'),
- },
- {
- path: '/workspace',
- name: 'workspace',
- component: () => import('@/views/main_web/workspace'),
- },
- {
- path: '/project',
- name: 'project',
- component: () => import('@/views/main_web/project'),
- },
- {
- path: '/recycle',
- name: 'recycle',
- component: () => import('@/views/main_web/workspace/recyclebin'),
- },
- {
- path: '/history',
- name: 'history',
- component: () => import('@/views/main_web/workspace/components/file-history'),
- },
- {
- path: '/cloud',
- name: 'cloud',
- component: () => import('@/views/main_web/cloud'),
- },
- {
- path: '/cloudrecycle',
- name: 'cloudrecycle',
- component: () => import('@/views/main_web/cloudrecycle'),
- },
- {
- path: '/cloudsource',
- name: 'cloudsource',
- component: () => import('@/views/main_web/cloudsource'),
- },
- // 探索者后台
- {
- path: '/company',
- name: 'company',
- component: () => import('@/views/manage_company'),
- redirect: { name: 'company_home' },
- children: [
- {
- path: 'home',
- name: 'company_home',
- component: () => import('@/views/manage_company/message'),
- },
- {
- path: 'message',
- name: 'company_message',
- component: () => import('@/views/manage_company/message_detail'),
- },
- {
- path: 'user',
- name: 'company_user',
- component: () => import('@/views/manage_company/user'),
- },
- {
- path: 'project',
- name: 'company_project',
- component: () => import('@/views/manage_company/project'),
- },
- {
- path: 'template',
- name: 'company_template',
- component: () => import('@/views/manage_company/template'),
- },
- {
- path: 'template/detail',
- name: 'company_template_detail',
- component: () => import('@/views/manage_company/template_detail'),
- },
- {
- path: 'template/market',
- name: 'company_template_market',
- component: () => import('@/views/manage_company/template_market'),
- },
- {
- path: 'setting',
- name: 'company_setting',
- component: () => import('@/views/manage_company/setting'),
- },
- {
- path: 'app',
- name: 'company_app',
- component: () => import('@/views/manage_company/app'),
- },
- ]
- },
- // {
- // path: '/company',
- // name: 'company',
- // component: () => import('@/views/manage_company/message'),
- // },
- // {
- // path: '/company/message',
- // name: 'company_message',
- // component: () => import('@/views/manage_company/message_detail'),
- // },
- // {
- // path: '/company/user',
- // name: 'company_user',
- // component: () => import('@/views/manage_company/user'),
- // },
- // {
- // path: '/company/project',
- // name: 'company_project',
- // component: () => import('@/views/manage_company/project'),
- // },
- // {
- // path: '/company/template',
- // name: 'company_template',
- // component: () => import('@/views/manage_company/template'),
- // },
- // {
- // path: '/company/template/detail',
- // name: 'company_template_detail',
- // component: () => import('@/views/manage_company/template_detail'),
- // },
- // {
- // path: '/company/template/market',
- // name: 'company_template_market',
- // component: () => import('@/views/manage_company/template_market'),
- // },
- // {
- // path: '/company/setting',
- // name: 'company_setting',
- // component: () => import('@/views/manage_company/setting'),
- // },
- // {
- // path: '/company/app',
- // name: 'company_app',
- // component: () => import('@/views/manage_company/app'),
- // },
- /* 模板平台 */
- {
- path: '/template',
- name: 'template',
- component: resolve => require(['@/views/manage_template/index'], resolve)
- },
- {
- path: '/template/create',
- name: 'template_create',
- component: resolve => require(['@/views/manage_template/create_template'], resolve)
- },
- // 探索者总后台
- {
- path: '/system',
- // name: 'system',
- component: () => import('@/views/manage_system'),
- redirect: { name: 'system_customer' },
- children: [{
- path: 'customer',
- name: 'system_customer',
- component: () => import('@/views/manage_system/customer'),
- },{
- path: 'template',
- name: 'system_template',
- component: () => import('@/views/manage_system/template'),
- },
- {
- path: 'runmanage',
- name: 'system_runmanage',
- component: () => import('@/views/manage_system/runmanage'),
- },
- {
- path: 'template/matrix',
- name: 'system_template_matrix',
- component: () => import('@/views/manage_system/template/matrix'),
- },
- {
- path: 'template/mind',
- name: 'system_template_mind',
- component: () => import('@/views/manage_system/template/mind'),
- },
- {
- path: 'template/tempfile',
- name: 'system_template_file',
- component: () => import('@/views/manage_system/template_file'),
- },
- {
- path: 'appcenter',
- name: 'system_appcenter',
- component: () => import('@/views/manage_system/appcenter'),
- },
- {
- path: 'appinfo',
- name: 'system_appinfo',
- component: () => import('@/views/manage_system/appinfo'),
- },
- {
- path: 'setting',
- name: 'system_setting',
- component: () => import('@/views/manage_system/setting'),
- },{
- path: '*',
- redirect: { name: 'system_customer' },
- }]
- },
- // {
- // path: '/system/template',
- // name: 'system_template',
- // component: () => import('@/views/manage_system/template'),
- // },
-
- // 页面未找到时提示(这个页面要放在最后)
- {
- path: '*',
- name: 'notfound',
- component: () => import('@/views/components_web/notFound/notFound'),
- }
- ]
- })
- // 添加路由验证
- router.beforeEach((to, from, next) => {
- if (to.path === '/') {
- next()
- } else {
- if (!sessionStorage.getItem('userId')) {
- next({
- path: '/'
- })
- } else {
- next()
- }
- }
- })
- // 导航后置守卫,可以在确定导航到目标页面时再更改title
- router.afterEach((to) => {
- window.document.title = constants[to.name] || 'LOCKING | 云建筑'
- })
- export default router
|