123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528 |
- import Vue from 'vue';
- import VueRouter from 'vue-router';
- import store from '@/store/index';
- const jwt = require('jsonwebtoken');
- const originalPush = VueRouter.prototype.push;
- VueRouter.prototype.push = function push(location) {
- return originalPush.call(this, location).catch((err) => err);
- };
- Vue.use(VueRouter);
- const market = [
- {
- path: '/market/patentInfo/index',
- meta: { title: '专利超市-专利检索' },
- component: () => import('../views/market/patentInfo/index.vue'),
- },
- {
- path: '/market/patentInfo/detail',
- meta: { title: '专利检索-详细信息' },
- component: () => import('../views/market/patentInfo/detail.vue'),
- },
- {
- path: '/market/transfer/index',
- meta: { title: '专利超市-专利转让' },
- component: () => import('../views/market/transfer/index.vue'),
- },
- {
- path: '/market/transfer/detail',
- meta: { title: '专利转让-详细信息' },
- component: () => import('../views/market/transfer/detail.vue'),
- },
- {
- path: '/market/demand/index',
- meta: { title: '专利超市-专利需求' },
- component: () => import('../views/market/demand/index.vue'),
- },
- {
- path: '/market/demand/detail',
- meta: { title: '专利需求-详细信息' },
- component: () => import('../views/market/demand/detail.vue'),
- },
- {
- path: '/market/navigation/index',
- meta: { title: '专利超市-专利导航' },
- component: () => import('../views/market/navigation/index.vue'),
- },
- ];
- const service = [
- {
- path: '/service/notice/index',
- meta: { title: '咨询服务-政策资讯' },
- component: () => import('../views/service/notice/index.vue'),
- },
- {
- path: '/service/notice/detail',
- meta: { title: '政策资讯-详细你信息' },
- component: () => import('../views/service/notice/detail.vue'),
- },
- {
- path: '/service/law/index',
- meta: { title: '咨询服务-法律法规' },
- component: () => import('../views/service/law/index.vue'),
- },
- {
- path: '/service/law/detail',
- meta: { title: '法律法规-详细信息' },
- component: () => import('../views/service/law/detail.vue'),
- },
- {
- path: '/service/dimension/index',
- meta: { title: '咨询服务-研究报告' },
- component: () => import('../views/service/dimension/index.vue'),
- },
- {
- path: '/service/dimension/detail',
- meta: { title: '研究报告-详细信息' },
- component: () => import('../views/service/dimension/detail.vue'),
- },
- {
- path: '/service/interflow/index',
- meta: { title: '咨询服务-交流互动' },
- component: () => import('../views/service/interflow/index.vue'),
- },
- {
- path: '/service/interflow/detail',
- meta: { title: '交流互动-详细信息' },
- component: () => import('../views/service/interflow/detail.vue'),
- },
- ];
- const account = [
- {
- path: '/account/index',
- meta: { title: '管理中心' },
- component: () => import('../views/account/index.vue'),
- },
- // 个人用户
- {
- path: '/account/userCenter/basic/index',
- meta: { title: '基本信息' },
- component: () => import('../views/account/userCenter/basic/index.vue'),
- },
- {
- path: '/account/userCenter/password/index',
- meta: { title: '修改密码' },
- component: () => import('../views/account/userCenter/password/index.vue'),
- },
- // 机构用户
- {
- path: '/account/mechCenter/users/index',
- meta: { title: '平台用户' },
- component: () => import('../views/account/mechCenter/users/index.vue'),
- },
- {
- path: '/account/mechCenter/users/detail',
- meta: { title: '平台用户-信息维护' },
- component: () => import('../views/account/mechCenter/users/detail.vue'),
- },
- {
- path: '/account/mechCenter/patent/index',
- meta: { title: '平台用户-专利信息' },
- component: () => import('../views/account/mechCenter/patent/index.vue'),
- },
- // 管理用户
- {
- path: '/account/adminCenter/mechanism/index',
- meta: { title: '机构用户' },
- component: () => import('../views/account/adminCenter/mechanism/index.vue'),
- },
- {
- path: '/account/adminCenter/mechanism/detail',
- meta: { title: '机构用户-信息维护' },
- component: () => import('../views/account/adminCenter/mechanism/detail.vue'),
- },
- {
- path: '/account/adminCenter/users/index',
- meta: { title: '平台用户' },
- component: () => import('../views/account/adminCenter/users/index.vue'),
- },
- {
- path: '/account/adminCenter/users/detail',
- meta: { title: '平台用户-信息维护' },
- component: () => import('../views/account/adminCenter/users/detail.vue'),
- },
- ];
- const patent = [
- {
- path: '/patent/index',
- meta: { title: '专利管理中心' },
- component: () => import('../views/patent/index.vue'),
- },
- // 专利超市
- {
- path: '/patent/market/index',
- meta: { title: '专利超市' },
- component: () => import('../views/patent/market/index.vue'),
- },
- {
- path: '/patent/market/detail',
- meta: { title: '专利超市-详细信息' },
- component: () => import('../views/patent/market/detail.vue'),
- },
- {
- path: '/patent/market/transDetail',
- meta: { title: '专利超市-详细信息' },
- component: () => import('../views/patent/market/transDetail.vue'),
- },
- // 资讯服务
- {
- path: '/patent/user/chat/index',
- meta: { title: '咨詢服务' },
- component: () => import('../views/patent/user/chat/index.vue'),
- },
- // 专利运营-个人用户
- // 我的消息
- {
- path: '/patent/user/message/unRead',
- meta: { title: '未读信息查看' },
- component: () => import('../views/patent/user/message/unRead.vue'),
- },
- {
- path: '/patent/user/message/read',
- meta: { title: '已读信息查看' },
- component: () => import('../views/patent/user/message/read.vue'),
- },
- {
- path: '/patent/user/message/notice',
- meta: { title: '通知查看' },
- component: () => import('../views/patent/user/message/notice.vue'),
- },
- // 我的申请
- // 专利申请
- {
- path: '/patent/user/apply/apply',
- meta: { title: '专利申请' },
- component: () => import('../views/patent/user/apply/apply/index.vue'),
- },
- {
- path: '/patent/user/apply/apply/detail',
- meta: { title: '专利申请-审批单' },
- component: () => import('../views/patent/user/apply/apply/detail.vue'),
- },
- {
- path: '/patent/user/apply/apply/result',
- meta: { title: '专利申请-审核结果' },
- component: () => import('../views/patent/user/apply/apply/result.vue'),
- },
- {
- path: '/patent/user/apply/apply/gzjDetail',
- meta: { title: '专利申请-国知局信息' },
- component: () => import('../views/patent/user/apply/apply/gzjDetail.vue'),
- },
- // 查新检索
- {
- path: '/patent/user/apply/analysis',
- meta: { title: '查新检索' },
- component: () => import('../views/patent/user/apply/analysis/index.vue'),
- },
- {
- path: '/patent/user/apply/analysis/detail',
- meta: { title: '查新检索-交底书' },
- component: () => import('../views/patent/user/apply/analysis/detail.vue'),
- },
- {
- path: '/patent/user/apply/analysis/result',
- meta: { title: '查新检索-审核结果' },
- component: () => import('../views/patent/user/apply/analysis/result.vue'),
- },
- //价值评估
- {
- path: '/patent/user/apply/assessment',
- meta: { title: '价值评估' },
- component: () => import('../views/patent/user/apply/assessment/index.vue'),
- },
- {
- path: '/patent/user/apply/assessment/detail',
- meta: { title: '价值评估-申请评估' },
- component: () => import('../views/patent/user/apply/assessment/detail.vue'),
- },
- {
- path: '/patent/user/apply/assessment/result',
- meta: { title: '价值评估-审核结果' },
- component: () => import('../views/patent/user/apply/assessment/result.vue'),
- },
- // 我的专利
- // 专利信息
- {
- path: '/patent/user/patent/information',
- meta: { title: '专利信息' },
- component: () => import('../views/patent/user/patent/information/index.vue'),
- },
- {
- path: '/patent/user/patent/information/detail',
- meta: { title: '专利信息-详细信息' },
- component: () => import('../views/patent/user/patent/information/detail.vue'),
- },
- {
- path: '/patent/user/patent/information/trans_create',
- meta: { title: '专利信息-发起交易' },
- component: () => import('../views/patent/user/patent/information/trans_create.vue'),
- },
- // 专利导航
- {
- path: '/patent/user/patent/navigation',
- meta: { title: '专利导航' },
- component: () => import('../views/patent/user/patent/navigation/index.vue'),
- },
- // 专利预警
- {
- path: '/patent/user/patent/early',
- meta: { title: '专利预警' },
- component: () => import('../views/patent/user/patent/early/index.vue'),
- },
- // 我的交易
- {
- path: '/patent/user/transaction/index',
- meta: { title: '专利交易' },
- component: () => import('../views/patent/user/transaction/index.vue'),
- },
- {
- path: '/patent/user/transaction/info',
- meta: { title: '专利交易-详细信息' },
- component: () => import('../views/patent/user/transaction/info.vue'),
- },
- {
- path: '/patent/user/transaction/contract',
- meta: { title: '专利交易-填写合同' },
- component: () => import('../views/patent/user/transaction/contract.vue'),
- },
- // 机构用户
- // 我的消息
- {
- path: '/patent/mech/message/unRead',
- meta: { title: '未读信息' },
- component: () => import('../views/patent/mech/message/unRead.vue'),
- },
- {
- path: '/patent/mech/message/read',
- meta: { title: '已读信息' },
- component: () => import('../views/patent/mech/message/read.vue'),
- },
- {
- path: '/patent/mech/message/notice',
- meta: { title: '通知信息' },
- component: () => import('../views/patent/mech/message/notice.vue'),
- },
- {
- path: '/patent/mech/message/notice_create',
- meta: { title: '通知信息-编辑通知' },
- component: () => import('../views/patent/mech/message/notice_create.vue'),
- },
- // 我的审核
- {
- path: '/patent/mech/examine/patent',
- meta: { title: '专利审核' },
- component: () => import('../views/patent/mech/examine/patent.vue'),
- },
- {
- path: '/patent/mech/examine/contract',
- meta: { title: '合同审核' },
- component: () => import('../views/patent/mech/examine/contract.vue'),
- },
- {
- path: '/patent/mech/examine/contract_check',
- meta: { title: '合同审核-详细信息' },
- component: () => import('../views/patent/mech/examine/contract_check.vue'),
- },
- {
- path: '/patent/mech/examine/trans',
- meta: { title: '交易审核' },
- component: () => import('../views/patent/mech/examine/trans.vue'),
- },
- // 我的专利
- {
- path: '/patent/mech/patent/information',
- meta: { title: '专利信息' },
- component: () => import('../views/patent/mech/patent/information/index.vue'),
- },
- {
- path: '/patent/mech/patent/information/detail',
- meta: { title: '专利信息-详细信息' },
- component: () => import('../views/patent/mech/patent/information/detail.vue'),
- },
- {
- path: '/patent/mech/patent/navigation',
- meta: { title: '查新检索' },
- component: () => import('../views/patent/mech/patent/navigation/index.vue'),
- },
- {
- path: '/patent/mech/patent/navigation/info',
- meta: { title: '查新检索-详细信息' },
- component: () => import('../views/patent/mech/patent/navigation/info.vue'),
- },
- {
- path: '/patent/mech/patent/early',
- meta: { title: '专利预警' },
- component: () => import('../views/patent/mech/patent/early/index.vue'),
- },
- // 我的交易
- {
- path: '/patent/mech/transaction/index',
- meta: { title: '专利交易' },
- component: () => import('../views/patent/mech/transaction/index.vue'),
- },
- {
- path: '/patent/mech/transaction/info',
- meta: { title: '专利交易-详细信息' },
- component: () => import('../views/patent/mech/transaction/info.vue'),
- },
- // 管理用户
- // 我的消息
- {
- path: '/patent/admin/message/service',
- meta: { title: '咨询服务' },
- component: () => import('../views/patent/admin/message/service.vue'),
- },
- {
- path: '/patent/admin/message/service_detail',
- meta: { title: '咨询服务-聊天详情' },
- component: () => import('../views/patent/admin/message/service_detail.vue'),
- },
- {
- path: '/patent/admin/message/notice',
- meta: { title: '通知信息' },
- component: () => import('../views/patent/admin/message/notice.vue'),
- },
- {
- path: '/patent/admin/message/notice_create',
- meta: { title: '通知信息-编辑通知' },
- component: () => import('../views/patent/admin/message/notice_create.vue'),
- },
- {
- path: '/patent/admin/message/examine',
- meta: { title: '审核通知' },
- component: () => import('../views/patent/admin/message/examine.vue'),
- },
- {
- path: '/patent/admin/message/warning',
- meta: { title: '专利预警' },
- component: () => import('../views/patent/admin/message/warning.vue'),
- },
- // 专利审核
- {
- path: '/patent/admin/examine/patent',
- meta: { title: '专利申请' },
- component: () => import('../views/patent/admin/examine/patent.vue'),
- },
- {
- path: '/patent/admin/examine/hairmess',
- meta: { title: '分发消息' },
- component: () => import('../views/patent/admin/examine/hairmess.vue'),
- },
- {
- path: '/patent/admin/examine/hairmess_create',
- meta: { title: '分发消息-添加消息' },
- component: () => import('../views/patent/admin/examine/hairmess_create.vue'),
- },
- {
- path: '/patent/admin/examine/hairmess_autoCreate',
- meta: { title: '分发消息-自动分发消息' },
- component: () => import('../views/patent/admin/examine/hairmess_autoCreate.vue'),
- },
- {
- path: '/patent/admin/examine/analysis',
- meta: { title: '查新检索' },
- component: () => import('../views/patent/admin/examine/analysis.vue'),
- },
- // 专利管理
- {
- path: '/patent/admin/patent/info',
- meta: { title: '专利信息' },
- component: () => import('../views/patent/admin/patent/info.vue'),
- },
- {
- path: '/patent/admin/patent/info_create',
- meta: { title: '专利信息-添加专利' },
- component: () => import('../views/patent/admin/patent/info_create.vue'),
- },
- {
- path: '/patent/admin/patent/info_import',
- meta: { title: '专利信息-导入专利' },
- component: () => import('../views/patent/admin/patent/info_import.vue'),
- },
- {
- path: '/patent/admin/patent/info_result',
- meta: { title: '专利信息-导出结果' },
- component: () => import('../views/patent/admin/patent/info_result.vue'),
- },
- {
- path: '/patent/admin/patent/assessment',
- meta: { title: '价值评估' },
- component: () => import('../views/patent/admin/patent/assessment.vue'),
- },
- {
- path: '/patent/admin/patent/assessment_examine',
- meta: { title: '价值评估-审核信息' },
- component: () => import('../views/patent/admin/patent/assessment_examine.vue'),
- },
- {
- path: '/patent/admin/patent/trans',
- meta: { title: '专利交易' },
- component: () => import('../views/patent/admin/patent/trans.vue'),
- },
- {
- path: '/patent/admin/patent/trans_info',
- meta: { title: '专利交易-详细信息' },
- component: () => import('../views/patent/admin/patent/trans_info.vue'),
- },
- {
- path: '/patent/admin/patent/techol',
- meta: { title: '专利需求' },
- component: () => import('../views/patent/admin/techol/index.vue'),
- },
- {
- path: '/patent/admin/techol/techol_info',
- meta: { title: '专利需求-详细信息' },
- component: () => import('../views/patent/admin/techol/techol_info.vue'),
- },
- ];
- const web = [
- {
- path: '/',
- name: 'index',
- meta: { title: '网站首页' },
- component: () => import('../views/index.vue'),
- },
- ...market,
- ...service,
- ...account,
- ...patent,
- {
- path: '/login',
- name: 'login',
- meta: { title: '登录', key: 'login' },
- component: () => import('../views/login.vue'),
- },
- {
- path: '/register',
- name: 'register',
- meta: { title: '账户注册', key: 'register' },
- component: () => import('../views/register.vue'),
- },
- ];
- const routes = [...web];
- const router = new VueRouter({
- mode: 'history',
- base: process.env.VUE_APP_ROUTER,
- routes,
- });
- router.beforeEach((to, from, next) => {
- let openid = to.query.openid;
- sessionStorage.setItem('openid', openid);
- document.title = `${to.meta.title} `;
- const token = localStorage.getItem('token');
- if (to.path == '/account/index' || to.path == '/patent/index') {
- if (!token) {
- next(`/login?path=${to.path}`);
- } else {
- let user = jwt.decode(token);
- store.commit('setUser', user, { root: true });
- next();
- }
- } else {
- let user = jwt.decode(token);
- store.commit('setUser', user, { root: true });
- next();
- }
- });
- export default router;
|