DSDSWeb/src/router/index.js

537 lines
14 KiB
JavaScript
Raw Normal View History

2024-07-11 18:02:47 +08:00
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout'
2024-08-02 16:56:07 +08:00
// import store from '../store'
// import {
// getParameterValue
// } from '@/utils/auth' // get token from cookie
// import {
// setToken, getToken, setUser, setUserID, getUserID
// } from '@/utils/auth' // get token from cookie
// import {
// getByUname
// } from '@/api/getByUname'
2024-07-11 18:02:47 +08:00
Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
export const constantRoutes = [
{
path: '/',
name: 'container',
redirect: '/container/home',
meta: {
title: '信息发布网站home',
icon: 'peoples'
}
},
// {
// path: '/',
// name: 'releaseConfig',
// component: Layout,
// redirect: '/releaseManagement',
// meta: {
// title: '发布管理',
// icon: 'peoples'
// }
// },
{
path: '/container',
name: 'container',
redirect: '/container/home',
component: () => import('@/components/container.vue'),
meta: {
title: '信息发布网站',
icon: 'peoples',
loginAuthority: true
},
children: [
{
path: 'home',
name: 'home',
component: () => import('@/views/home.vue'),
meta: {
title: 'home',
icon: 'peoples',
loginAuthority: true
}
},
{
2024-07-26 17:55:44 +08:00
path: 'voyageReg',
name: 'VoyageReg',
component: () => import('@/views/dataTransfer/voyageReg.vue'),
2024-07-11 18:02:47 +08:00
meta: {
title: '航次数据汇交',
icon: 'peoples',
loginAuthority: true
}
},
{
2024-07-26 17:55:44 +08:00
path: 'sampleDataset',
name: 'SampleDataset',
component: () => import('@/views/dataTransfer/sampleDataset.vue'),
2024-07-11 18:02:47 +08:00
meta: {
2024-07-26 17:55:44 +08:00
title: '数据样品信息汇交',
2024-07-11 18:02:47 +08:00
icon: 'peoples',
loginAuthority: true
}
},
2024-07-26 17:55:44 +08:00
// {
// path: 'voyageDelivery',
// name: 'voyageDelivery',
// component: () => import('@/views/voyageDelivery.vue'),
// meta: {
// title: '航次数据汇交',
// icon: 'peoples',
// loginAuthority: true
// }
// },
2024-07-11 18:02:47 +08:00
{
2024-07-26 17:55:44 +08:00
path: 'voyageEntry',
name: 'voyageEntry',
component: () => import('@/views/voyageEntry.vue'),
2024-07-11 18:02:47 +08:00
meta: {
2024-07-26 17:55:44 +08:00
title: '航次信息录入',
2024-07-11 18:02:47 +08:00
icon: 'peoples',
loginAuthority: true
}
},
2024-07-26 17:55:44 +08:00
// {
// path: 'sampleRemitt',
// name: 'sampleRemitt',
// component: () => import('@/views/sampleRemitt.vue'),
// meta: {
// title: '数据样品信息汇交',
// icon: 'peoples',
// loginAuthority: true
// }
// },
2024-07-11 18:02:47 +08:00
{
path: 'sampleEntry',
name: 'sampleEntry',
component: () => import('@/views/sampleEntry.vue'),
meta: {
title: '数据样品信息录入',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'dataSampleType',
name: 'dataSampleType',
component: () => import('@/views/dicManage/dataSampleType.vue'),
meta: {
title: '数据样品类型',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'docType',
name: 'docType',
component: () => import('@/views/dicManage/docType.vue'),
meta: {
title: '设备类型',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'platformType',
name: 'platformType',
component: () => import('@/views/dicManage/platformType.vue'),
meta: {
title: '平台类型',
icon: 'peoples',
loginAuthority: true
}
},
2025-04-23 13:48:08 +08:00
{
path: 'fundingAgencies',
name: 'fundingAgencies',
component: () => import('@/views/dicManage/fundingAgencies.vue'),
meta: {
title: '资助机构',
icon: 'peoples',
loginAuthority: true
}
},
2024-07-11 18:02:47 +08:00
{
path: 'visitorUnit',
name: 'visitorUnit',
component: () => import('@/views/dicManage/visitorUnit.vue'),
meta: {
title: '参航单位',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'sharedUnit',
name: 'sharedUnit',
component: () => import('@/views/dicManage/sharedUnit.vue'),
meta: {
title: '共享单位',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'userManage',
name: 'userManage',
component: () => import('@/views/sysManage/userManage.vue'),
meta: {
title: '用户管理',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'roleManage',
name: 'roleManage',
component: () => import('@/views/sysManage/roleManage.vue'),
meta: {
title: '角色管理',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'unitManage',
name: 'unitManage',
component: () => import('@/views/sysManage/unitManage.vue'),
meta: {
title: '单位管理',
icon: 'peoples',
loginAuthority: true
}
},
// {
// path: 'GMRT',
// name: 'GMRT',
// component: () => import('@/views/GMRT.vue'),
// meta: {
// title: '地图',
// icon: 'peoples',
// loginAuthority: true
// }
// },
{
path: 'dataSearch',
name: 'dataSearch',
component: () => import('@/views/dataSearch.vue'),
meta: {
title: '数据检索',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'voyagedetail',
name: 'voyagedetail',
component: () => import('@/views/voyagedetail.vue'),
meta: {
title: '航次详情',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'dataDetail',
name: 'dataDetail',
component: () => import('@/views/dataDetail.vue'),
meta: {
title: '数据产品详情',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'personalCenter',
name: 'personalCenter',
component: () => import('@/views/personalCenter.vue'),
meta: {
title: '个人中心',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'biologyIndex',
name: 'biologyIndex',
component: () => import('@/views/sublibrary/biologyIndex.vue'),
meta: {
title: '生物子库',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'genovariation',
name: 'genovariation',
component: () => import('@/views/sublibrary/biologyGenovariation.vue'),
meta: {
title: '生物基因变异',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'physicalIndex',
name: 'physicalIndex',
component: () => import('@/views/sublibrary/physicalIndex.vue'),
meta: {
title: '物理子库',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'physicalDataDelivery',
name: 'physicalDataDelivery',
component: () => import('@/views/sublibrary/physicalDataDelivery.vue'),
meta: {
title: '数据汇交',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'physicalDataSearchCTD',
name: 'physicalDataSearchCTD',
component: () => import('@/views/sublibrary/physicalDataSearchCTD.vue'),
meta: {
title: '温盐深(CTD) 数据应用',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'phoneVideoIndex',
name: 'phoneVideoIndex',
component: () => import('@/views/sublibrary/phoneVideoIndex.vue'),
meta: {
title: '视频音像子库',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'news',
name: 'news',
component: () => import('@/views/news.vue'),
meta: {
title: '新闻动态',
icon: 'peoples',
loginAuthority: true
}
},
// {
// path: 'analyse',
// name: 'analyse',
// component: () => import('@/views/analyse.vue'),
// meta: {
// title: '统计分析',
// icon: 'peoples',
// loginAuthority: true
// }
// },
2024-07-11 18:02:47 +08:00
{
path: 'statistics',
name: 'statistics',
component: () => import('@/views/statistics/index.vue'),
2024-07-11 18:02:47 +08:00
meta: {
title: '统计分析',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'ships',
name: 'ships',
component: () => import('@/views/statistics/ShipStatistics.vue'),
meta: {
title: '科考船汇总统计',
icon: 'peoples',
loginAuthority: true
}
},
2025-04-23 13:48:08 +08:00
{
path: 'AboutUs',
name: 'AboutUs',
component: () => import('@/views/aboutUs.vue'),
meta: {
title: '关于我们',
icon: 'peoples',
loginAuthority: true
}
},
2024-07-11 18:02:47 +08:00
{
path: 'login',
name: 'login',
component: () => import('@/views/login.vue'),
meta: {
title: '登录',
icon: 'peoples',
loginAuthority: true
}
},
{
path: 'links',
name: 'links',
component: () => import('@/views/links.vue'),
meta: {
title: 'links',
icon: 'peoples',
loginAuthority: true
}
}
]
},
{
path: '/releaseManagement',
component: Layout,
redirect: '/releaseManagement/releaseCount',
name: 'releaseCount',
meta: {
title: '发布管理',
icon: 'peoples'
// roles: ['ADMIN']
},
children: [
{
path: 'releaseCount',
name: 'releaseCount',
// @ts-ignore
component: () => import('@/views/releaseCount.vue'),
meta: {
title: '发布统计',
icon: 'peoples'
}
},
{
path: 'releaseConfig',
name: 'releaseConfig',
// @ts-ignore
component: () => import('@/views/releaseMang/releaseConfig.vue'),
redirect: '/releaseManagement/releaseConfig/faqConfig',
meta: {
title: '发布配置'
},
children: [{
path: 'faqConfig',
name: 'faqConfig',
component: () => import('@/views/releaseMang/faqConfig.vue'),
meta: {
title: 'faq配置',
icon: 'peoples'
}
},
{
path: 'urlConfig',
name: 'urlConfig',
component: () => import('@/views/releaseMang/urlConfig.vue'),
meta: {
title: 'url配置',
icon: 'peoples'
}
},
{
path: 'softConfig',
name: 'softConfig',
component: () => import('@/views/releaseMang/softConfig.vue'),
meta: {
title: '软件配置',
icon: 'peoples'
}
},
{
path: 'pubDynamic',
name: 'pubDynamic',
component: () => import('@/views/releaseMang/pubDynamic.vue'),
meta: {
title: '发布动态配置',
icon: 'peoples'
}
}
]
}
]
},
{
path: '/noPermission',
name: 'noPermission',
component: () => import('@/views/noPermission'),
meta: {
title: 'noPermission',
closed: true,
loginAuthority: true
}
}
// {
// path: '/second',
// name: 'secondIndex',
// component: secondIndex,
// redirect: '/Index',//设置默认指向的路径
// children: [ //这里就是二级路由的配置
// {
// path: '/talent',
// name: 'TalentMain',
// component: TalentMain
// }
// ]
// },
]
const createRouter = () => new Router({
// base: '/asos_client/',
routes: constantRoutes
// mode: "history"
})
const router = createRouter()
router.beforeEach((to, from, next) => {
2024-09-27 17:55:41 +08:00
to.meta.title && (document.title = to.meta.title + ' | Deep-Sea Data System')
2024-08-02 16:56:07 +08:00
// const jsid = getParameterValue('jsessionid')
// const cu = getParameterValue('cu')
// const userID = getParameterValue('userId')
2024-07-11 18:02:47 +08:00
// 如果url上用户名 cu userId到本地
2024-08-02 16:56:07 +08:00
// if (!!jsid && !!cu) {
// setToken(jsid)
// setUser(cu)
// setUserID(userID)
// window.sessionStorage.setItem('cu', cu)
// }
// window.sessionStorage.setItem('userID', getUserID())
// store.dispatch('app/setUser')
// const hasToken = getToken()
2024-07-11 18:02:47 +08:00
// 个人空间和后台系统需要登录 loginAuthority为true就是可以免登陆
// if (!to.meta.loginAuthority) {
// window.sessionStorage.setItem('sign', 'asos_service')
// if (!hasToken) {
// window.location.href = process.env.VUE_APP_CAS_LOGIN_BACK
// } else {
// getByUname().then(res => {
// if (res.data) {
// if (res.data.indexOf('admin') > -1) {
// next()
// } else {
// next({
// path: '/noPermission'
// })
// }
// }
// })
// }
// } else {
// next()
// }
next() // 继续执行
})
export default router