123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556 |
- 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);
- // 2021-07-07
- // 科创资讯
- const scientific = [
- {
- path: '/scientific/notice/index',
- meta: { title: '科创资讯-通知通告' },
- component: () => import('../views/scientific/notice/index.vue'),
- },
- {
- path: '/scientific/notice/detail',
- meta: { title: '通知通告-详细信息' },
- component: () => import('../views/scientific/notice/detail.vue'),
- },
- {
- path: '/scientific/analysis/index',
- meta: { title: '科创资讯-政策信息' },
- component: () => import('../views/scientific/analysis/index.vue'),
- },
- {
- path: '/scientific/analysis/detail',
- meta: { title: '政策信息-详细信息' },
- component: () => import('../views/scientific/analysis/detail.vue'),
- },
- {
- path: '/scientific/industry/index',
- meta: { title: '科创资讯-医药资讯' },
- component: () => import('../views/scientific/industry/index.vue'),
- },
- {
- path: '/scientific/industry/detail',
- meta: { title: '医药资讯-详细信息' },
- component: () => import('../views/scientific/industry/detail.vue'),
- },
- {
- path: '/scientific/viewpoint/index',
- meta: { title: '科创资讯-智库视点' },
- component: () => import('../views/scientific/viewpoint/index.vue'),
- },
- {
- path: '/scientific/viewpoint/detail',
- meta: { title: '智库视点-详细信息' },
- component: () => import('../views/scientific/viewpoint/detail.vue'),
- },
- {
- path: '/scientific/navigation/index',
- meta: { title: '科创资讯-数据导航' },
- component: () => import('../views/scientific/navigation/index.vue'),
- },
- ];
- // 服务在线
- const service = [
- {
- path: '/service/contract/index',
- meta: { title: '服务在线-技术合同' },
- component: () => import('../views/service/contract/index.vue'),
- },
- {
- path: '/service/achieve/index',
- meta: { title: '服务在线-成果评价' },
- component: () => import('../views/service/achieve/index.vue'),
- },
- {
- path: '/service/achieve/detail',
- meta: { title: '成果评价-详细信息' },
- component: () => import('../views/service/achieve/detail.vue'),
- },
- {
- path: '/service/novelty/index',
- meta: { title: '服务在线-查新服务' },
- component: () => import('../views/service/novelty/index.vue'),
- },
- {
- path: '/service/patent/index',
- meta: { title: '服务在线-专利运营' },
- component: () => import('../views/service/patent/index.vue'),
- },
- {
- path: '/service/continue/index',
- meta: { title: '服务在线-高企咨询' },
- component: () => import('../views/service/continue/index.vue'),
- },
- ];
- // 交流互动
- const exchange = [
- {
- path: '/exchange/project/index',
- meta: { title: '交流互动-项目征集' },
- component: () => import('../views/exchange/project/index.vue'),
- },
- {
- path: '/exchange/question/index',
- meta: { title: '交流互动-调查问卷' },
- component: () => import('../views/exchange/question/index.vue'),
- },
- {
- path: '/exchange/business/index',
- meta: { title: '交流互动-咨询服务' },
- component: () => import('../views/exchange/business/index.vue'),
- },
- {
- path: '/exchange/business/detail',
- meta: { title: '咨询服务-详细信息' },
- component: () => import('../views/exchange/business/detail.vue'),
- },
- {
- path: '/exchange/center/index',
- meta: { title: '个人中心' },
- component: () => import('../views/exchange/center/index.vue'),
- },
- // 管理用户
- {
- path: '/exchange/center/adminCenter/mechanism/index',
- meta: { title: '机构用户' },
- component: () => import('../views/exchange/center/adminCenter/mechanism/index.vue'),
- },
- {
- path: '/exchange/center/adminCenter/mechanism/detail',
- meta: { title: '机构用户-详细信息' },
- component: () => import('../views/exchange/center/adminCenter/mechanism/detail.vue'),
- },
- {
- path: '/exchange/center/adminCenter/users/index',
- meta: { title: '平台用户' },
- component: () => import('../views/exchange/center/adminCenter/users/index.vue'),
- },
- {
- path: '/exchange/center/adminCenter/users/detail',
- meta: { title: '平台用户-详细信息' },
- component: () => import('../views/exchange/center/adminCenter/users/detail.vue'),
- },
- // 机构用户
- {
- path: '/exchange/center/mechCenter/users/index',
- meta: { title: '平台用户' },
- component: () => import('../views/exchange/center/mechCenter/users/index.vue'),
- },
- {
- path: '/exchange/center/mechCenter/users/detail',
- meta: { title: '平台用户-详细信息' },
- component: () => import('../views/exchange/center/mechCenter/users/detail.vue'),
- },
- // 平台用户-专利信息
- {
- path: '/exchange/center/mechCenter/patent/index',
- meta: { title: '专利信息' },
- component: () => import('../views/exchange/center/mechCenter/patent/index.vue'),
- },
- // 个人(企业)用户
- {
- path: '/exchange/center/userCenter/basic/index',
- meta: { title: '基本信息' },
- component: () => import('../views/exchange/center/userCenter/basic/index.vue'),
- },
- {
- path: '/exchange/center/userCenter/password/index',
- meta: { title: '修改密码' },
- component: () => import('../views/exchange/center/userCenter/password/index.vue'),
- },
- // {
- // path: '/exchange/center/user/index',
- // meta: { title: '关联用户' },
- // component: () => import('../views/exchange/center/user/index.vue'),
- // },
- ];
- //专利运营-2021-08-27
- const zlyy = [
- // 管理员-我的消息
- // 管理员-咨询服务
- {
- path: '/service/patent/admin/message/service',
- meta: { title: '咨询服务' },
- component: () => import('../views/service/patent/admin/message/service.vue'),
- },
- {
- path: '/service/patent/admin/message/service_detail',
- meta: { title: '咨询服务-聊天详情' },
- component: () => import('../views/service/patent/admin/message/service_detail.vue'),
- },
- // 管理员-通知信息
- {
- path: '/service/patent/admin/message/notice',
- meta: { title: '通知信息' },
- component: () => import('../views/service/patent/admin/message/notice.vue'),
- },
- {
- path: '/service/patent/admin/message/notice_create',
- meta: { title: '通知信息-编辑通知' },
- component: () => import('../views/service/patent/admin/message/notice_create.vue'),
- },
- // 管理员-审核通知
- {
- path: '/service/patent/admin/message/examine',
- meta: { title: '审核通知' },
- component: () => import('../views/service/patent/admin/message/examine.vue'),
- },
- // 管理员-专利预警
- {
- path: '/service/patent/admin/message/warning',
- meta: { title: '专利预警' },
- component: () => import('../views/service/patent/admin/message/warning.vue'),
- },
- // 管理员-专利审核
- {
- path: '/service/patent/admin/examine/patent',
- meta: { title: '专利申请' },
- component: () => import('../views/service/patent/admin/examine/patent.vue'),
- },
- // 国知局反馈消息
- {
- path: '/service/patent/admin/examine/hairmess',
- meta: { title: '分发消息' },
- component: () => import('../views/service/patent/admin/examine/hairmess.vue'),
- },
- {
- path: '/service/patent/admin/examine/hairmess_create',
- meta: { title: '分发消息-添加消息' },
- component: () => import('../views/service/patent/admin/examine/hairmess_create.vue'),
- },
- {
- path: '/service/patent/admin/examine/analysis',
- meta: { title: '专利分析' },
- component: () => import('../views/service/patent/admin/examine/analysis.vue'),
- },
- // 管理员-专利申请管理
- {
- path: '/service/patent/admin/patent/info',
- meta: { title: '专利信息' },
- component: () => import('../views/service/patent/admin/patent/info.vue'),
- },
- {
- path: '/service/patent/admin/patent/info_create',
- meta: { title: '专利信息-添加专利' },
- component: () => import('../views/service/patent/admin/patent/info_create.vue'),
- },
- {
- path: '/service/patent/admin/patent/info_import',
- meta: { title: '专利信息-导入专利' },
- component: () => import('../views/service/patent/admin/patent/info_import.vue'),
- },
- {
- path: '/service/patent/admin/patent/info_result',
- meta: { title: '专利信息-导出结果' },
- component: () => import('../views/service/patent/admin/patent/info_result.vue'),
- },
- // 管理员-专利评估管理
- {
- path: '/service/patent/admin/patent/assessment',
- meta: { title: '专利评估' },
- component: () => import('../views/service/patent/admin/patent/assessment.vue'),
- },
- {
- path: '/service/patent/admin/patent/assessment_examine',
- meta: { title: '专利评估-审核信息' },
- component: () => import('../views/service/patent/admin/patent/assessment_examine.vue'),
- },
- // 管理员-专利交易管理
- {
- path: '/service/patent/admin/patent/trans',
- meta: { title: '专利交易' },
- component: () => import('../views/service/patent/admin/patent/trans.vue'),
- },
- {
- path: '/service/patent/admin/patent/trans_info',
- meta: { title: '专利交易-详细信息' },
- component: () => import('../views/service/patent/admin/patent/trans_info.vue'),
- },
- // 机构用户
- // 机构用户-我的消息
- {
- path: '/service/patent/mech/message/unRead',
- meta: { title: '未读信息' },
- component: () => import('../views/service/patent/mech/message/unRead.vue'),
- },
- {
- path: '/service/patent/mech/message/read',
- meta: { title: '已读信息' },
- component: () => import('../views/service/patent/mech/message/read.vue'),
- },
- {
- path: '/service/patent/mech/message/notice',
- meta: { title: '通知信息' },
- component: () => import('../views/service/patent/mech/message/notice.vue'),
- },
- {
- path: '/service/patent/mech/message/notice_create',
- meta: { title: '通知信息-编辑通知' },
- component: () => import('../views/service/patent/mech/message/notice_create.vue'),
- },
- // 机构用户-我的审核
- {
- path: '/service/patent/mech/examine/patent',
- meta: { title: '专利审核' },
- component: () => import('../views/service/patent/mech/examine/patent.vue'),
- },
- {
- path: '/service/patent/mech/examine/contract',
- meta: { title: '合同审核' },
- component: () => import('../views/service/patent/mech/examine/contract.vue'),
- },
- {
- path: '/service/patent/mech/examine/contract_check',
- meta: { title: '合同审核-详细信息' },
- component: () => import('../views/service/patent/mech/examine/contract_check.vue'),
- },
- {
- path: '/service/patent/mech/examine/trans',
- meta: { title: '交易审核' },
- component: () => import('../views/service/patent/mech/examine/trans.vue'),
- },
- // 机构用户-我的专利
- {
- path: '/service/patent/mech/patent/information',
- meta: { title: '专利信息' },
- component: () => import('../views/service/patent/mech/patent/information/index.vue'),
- },
- {
- path: '/service/patent/mech/patent/information/detail',
- meta: { title: '专利信息-详细信息' },
- component: () => import('../views/service/patent/mech/patent/information/detail.vue'),
- },
- {
- path: '/service/patent/mech/patent/navigation',
- meta: { title: '专利分析' },
- component: () => import('../views/service/patent/mech/patent/navigation/index.vue'),
- },
- {
- path: '/service/patent/mech/patent/navigation/info',
- meta: { title: '专利分析-详细信息' },
- component: () => import('../views/service/patent/mech/patent/navigation/info.vue'),
- },
- {
- path: '/service/patent/mech/patent/early',
- meta: { title: '专利预警' },
- component: () => import('../views/service/patent/mech/patent/early/index.vue'),
- },
- // 机构用户-我的交易
- {
- path: '/service/patent/mech/transaction/index',
- meta: { title: '专利交易' },
- component: () => import('../views/service/patent/mech/transaction/index.vue'),
- },
- {
- path: '/service/patent/mech/transaction/info',
- meta: { title: '专利交易-详细信息' },
- component: () => import('../views/service/patent/mech/transaction/info.vue'),
- },
- // 用户
- // 用户-我的消息
- {
- path: '/service/patent/user/message/unRead',
- meta: { title: '未读信息查看' },
- component: () => import('../views/service/patent/user/message/unRead.vue'),
- },
- {
- path: '/service/patent/user/message/read',
- meta: { title: '已读信息查看' },
- component: () => import('../views/service/patent/user/message/read.vue'),
- },
- {
- path: '/service/patent/user/message/notice',
- meta: { title: '通知查看' },
- component: () => import('../views/service/patent/user/message/notice.vue'),
- },
- {
- path: '/service/patent/user/message/read_chat',
- meta: { title: '聊天' },
- component: () => import('../views/service/patent/user/message/read_chat.vue'),
- },
- // 用户-我的申请
- // 用户-专利申请
- {
- path: '/service/patent/user/apply/apply',
- meta: { title: '专利申请' },
- component: () => import('../views/service/patent/user/apply/apply/index.vue'),
- },
- {
- path: '/service/patent/user/apply/apply/detail',
- meta: { title: '专利申请-审批单' },
- component: () => import('../views/service/patent/user/apply/apply/detail.vue'),
- },
- {
- path: '/service/patent/user/apply/apply/result',
- meta: { title: '专利申请-审核结果' },
- component: () => import('../views/service/patent/user/apply/apply/result.vue'),
- },
- {
- path: '/service/patent/user/apply/apply/gzjDetail',
- meta: { title: '专利申请-国知局信息' },
- component: () => import('../views/service/patent/user/apply/apply/gzjDetail.vue'),
- },
- // 用户-专利分析
- {
- path: '/service/patent/user/apply/analysis',
- meta: { title: '专利分析' },
- component: () => import('../views/service/patent/user/apply/analysis/index.vue'),
- },
- {
- path: '/service/patent/user/apply/analysis/detail',
- meta: { title: '专利分析-交底书' },
- component: () => import('../views/service/patent/user/apply/analysis/detail.vue'),
- },
- {
- path: '/service/patent/user/apply/analysis/result',
- meta: { title: '专利分析-审核结果' },
- component: () => import('../views/service/patent/user/apply/analysis/result.vue'),
- },
- // 用户-专利评估
- {
- path: '/service/patent/user/apply/assessment',
- meta: { title: '专利评估' },
- component: () => import('../views/service/patent/user/apply/assessment/index.vue'),
- },
- {
- path: '/service/patent/user/apply/assessment/detail',
- meta: { title: '专利评估-申请评估' },
- component: () => import('../views/service/patent/user/apply/assessment/detail.vue'),
- },
- {
- path: '/service/patent/user/apply/assessment/result',
- meta: { title: '专利评估-审核结果' },
- component: () => import('../views/service/patent/user/apply/assessment/result.vue'),
- },
- // 用户-我的专利
- {
- path: '/service/patent/user/patent/information',
- meta: { title: '专利信息' },
- component: () => import('../views/service/patent/user/patent/information/index.vue'),
- },
- {
- path: '/service/patent/user/patent/information/detail',
- meta: { title: '专利信息-详细信息' },
- component: () => import('../views/service/patent/user/patent/information/detail.vue'),
- },
- {
- path: '/service/patent/user/patent/information/trans_create',
- meta: { title: '专利信息-发起交易' },
- component: () => import('../views/service/patent/user/patent/information/trans_create.vue'),
- },
- // 用户-专利导航
- {
- path: '/service/patent/user/patent/navigation',
- meta: { title: '专利导航' },
- component: () => import('../views/service/patent/user/patent/navigation/index.vue'),
- },
- // 用户-专利预警
- {
- path: '/service/patent/user/patent/early',
- meta: { title: '专利预警' },
- component: () => import('../views/service/patent/user/patent/early/index.vue'),
- },
- // 用户-专利交易
- {
- path: '/service/patent/user/transaction/index',
- meta: { title: '专利交易' },
- component: () => import('../views/service/patent/user/transaction/index.vue'),
- },
- {
- path: '/service/patent/user/transaction/info',
- meta: { title: '专利交易-详细信息' },
- component: () => import('../views/service/patent/user/transaction/info.vue'),
- },
- {
- path: '/service/patent/user/transaction/contract',
- meta: { title: '专利交易-填写合同' },
- component: () => import('../views/service/patent/user/transaction/contract.vue'),
- },
- // 公共专利
- {
- path: '/service/patent/market/index',
- meta: { title: '专利超市' },
- component: () => import('../views/service/patent/market/index.vue'),
- },
- {
- path: '/service/patent/market/detail',
- meta: { title: '专利超市-专利信息' },
- component: () => import('../views/service/patent/market/detail.vue'),
- },
- {
- path: '/service/patent/market/transDetail',
- meta: { title: '专利超市-交易信息' },
- component: () => import('../views/service/patent/market/transDetail.vue'),
- },
- ];
- const web = [
- {
- path: '/',
- name: 'index',
- meta: { title: '网站首页' },
- component: () => import('../views/index.vue'),
- },
- ...scientific,
- ...service,
- ...exchange,
- ...zlyy,
- {
- 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 = 'oFqNO6VHEEwnMB_l1AD3pooBAkHk';
- let openid = to.query.openid;
- sessionStorage.setItem('openid', openid);
- document.title = `${to.meta.title} `;
- const token = localStorage.getItem('token');
- // 不带参数
- if (to.path == '/exchange/center/index') {
- if (!token) {
- next(`/login?path=${to.path}&&type=1`);
- } else {
- let user = jwt.decode(token);
- store.commit('setUser', user, { root: true });
- next();
- }
- // 带参数
- // } else if (to.path == '/finance/apply') {
- // if (!token) {
- // next(`/login?path=${to.fullPath}`);
- // } 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;
|