123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511 |
- 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 fwjg = [
- // 服务机构-用户管理
- {
- path: '/adminCenter/organization',
- name: 'admin_organization',
- meta: { title: '企业' },
- component: () => import('../views/adminCenter/organization/index.vue'),
- },
- {
- path: '/adminCenter/organization/detail',
- name: 'admin_organization_detail',
- meta: { title: '企业-信息管理' },
- component: () => import('../views/adminCenter/organization/detail.vue'),
- },
- {
- path: '/adminCenter/mechanism',
- name: 'admin_mechanism',
- meta: { title: '机构' },
- component: () => import('../views/adminCenter/mechanism/index.vue'),
- },
- {
- path: '/adminCenter/mechanism/detail',
- name: 'admin_mechanism_detail',
- meta: { title: '机构-信息管理' },
- component: () => import('../views/adminCenter/mechanism/detail.vue'),
- },
- {
- path: '/adminCenter/expert',
- name: 'admin_expert',
- meta: { title: '专家' },
- component: () => import('../views/adminCenter/expert/index.vue'),
- },
- {
- path: '/adminCenter/expert/detail',
- name: 'admin_expert_detail',
- meta: { title: '专家-信息管理' },
- component: () => import('../views/adminCenter/expert/detail.vue'),
- },
- // 服务机构-技术超市
- {
- path: '/adminCenter/product',
- name: 'admin_product',
- meta: { title: '信息发布' },
- component: () => import('../views/adminCenter/product/index.vue'),
- },
- {
- path: '/adminCenter/product/detail',
- name: 'admin_product_detail',
- meta: { title: '信息发布-信息管理' },
- component: () => import('../views/adminCenter/product/detail.vue'),
- },
- {
- path: '/adminCenter/patent',
- name: 'admin_patent',
- meta: { title: '专利' },
- component: () => import('../views/adminCenter/patent/index.vue'),
- },
- {
- path: '/adminCenter/patent/detail',
- name: 'admin_patent_detail',
- meta: { title: '专利-信息管理' },
- component: () => import('../views/adminCenter/patent/detail.vue'),
- },
- // 服务机构-新闻资讯
- {
- path: '/adminCenter/news',
- name: 'admin_news',
- meta: { title: '新闻资讯' },
- component: () => import('../views/adminCenter/news/index.vue'),
- },
- {
- path: '/adminCenter/news/detail',
- name: 'admin_news_detail',
- meta: { title: '新闻资讯-信息管理' },
- component: () => import('../views/adminCenter/news/detail.vue'),
- },
- // 服务机构-宣传培训
- {
- path: '/adminCenter/online',
- name: 'admin_online',
- meta: { title: '宣传培训' },
- component: () => import('../views/adminCenter/online/index.vue'),
- },
- {
- path: '/adminCenter/online/detail',
- name: 'admin_online_detail',
- meta: { title: '宣传培训-信息管理' },
- component: () => import('../views/adminCenter/online/detail.vue'),
- },
- {
- path: '/adminCenter/openinfo',
- name: 'admin_openinfo',
- meta: { title: '信息公开' },
- component: () => import('../views/adminCenter/openinfo/index.vue'),
- },
- {
- path: '/adminCenter/openinfo/detail',
- name: 'admin_openinfo_detail',
- meta: { title: '信息公开-信息管理' },
- component: () => import('../views/adminCenter/openinfo/detail.vue'),
- },
- {
- path: '/adminCenter/online/file',
- name: 'admin_online_file',
- meta: { title: '线上管理' },
- component: () => import('../views/adminCenter/online/file.vue'),
- },
- // 服务机构-创新券
- {
- path: '/adminCenter/coupons',
- name: 'admin_coupons_index',
- meta: { title: '创新券' },
- component: () => import('../views/adminCenter/coupons/index.vue'),
- },
- {
- path: '/adminCenter/coupons/detail',
- name: 'admin_policy_detail',
- meta: { title: '创新券-信息管理' },
- component: () => import('../views/adminCenter/coupons/detail.vue'),
- },
- {
- path: '/adminCenter/coupons/apply',
- name: 'admin_coupons_apply',
- meta: { title: '创新券-申领管理' },
- component: () => import('../views/adminCenter/coupons/apply.vue'),
- },
- {
- path: '/adminCenter/coupons/apply_check',
- name: 'admin_coupons_apply_check',
- meta: { title: '创新券-申领审核管理' },
- component: () => import('../views/adminCenter/coupons/apply_check.vue'),
- },
- {
- path: '/adminCenter/coupons/apply_info',
- name: 'admin_coupons_apply_info',
- meta: { title: '创新券-申领审核结果查看' },
- component: () => import('../views/adminCenter/coupons/apply_info.vue'),
- },
- // 服务机构-高企申报
- {
- path: '/adminCenter/declare',
- name: 'admin_declare_index',
- meta: { title: '高企申报' },
- component: () => import('../views/adminCenter/declare/index.vue'),
- },
- {
- path: '/adminCenter/declare/check',
- name: 'admin_declare_check',
- meta: { title: '高企申报-申报确认' },
- component: () => import('../views/adminCenter/declare/check.vue'),
- },
- // 服务机构-兑付管理
- {
- path: '/adminCenter/cashing/coupons',
- name: 'admin_cashing_coupons',
- meta: { title: '创新券兑付' },
- component: () => import('../views/adminCenter/cashing/coupons/index.vue'),
- },
- {
- path: '/adminCenter/cashing/coupons/detail',
- name: 'admin_cashing_coupons_detail',
- meta: { title: '创新券兑付-审核管理' },
- component: () => import('../views/adminCenter/cashing/coupons/detail.vue'),
- },
- // 服务机构-订单
- // {
- // path: '/adminCenter/order/list',
- // name: 'admin_order_list',
- // meta: { title: '服务订单' },
- // component: () => import('../views/adminCenter/order/list.vue'),
- // },
- // {
- // path: '/adminCenter/order/update',
- // name: 'admin_order_update',
- // meta: { title: '修改服务订单' },
- // component: () => import('../views/adminCenter/order/update.vue'),
- // },
- // 服务机构-高企申报
- // {
- // path: '/adminCenter/ticket',
- // name: 'admin_ticket',
- // meta: { title: '高企申报' },
- // component: () => import('../views/adminCenter/ticket/index.vue'),
- // },
- // {
- // path: '/adminCenter/ticket/detail',
- // name: 'admin_ticket_detail',
- // meta: { title: '高企申报-信息管理' },
- // component: () => import('../views/adminCenter/ticket/detail.vue'),
- // },
- // {
- // path: '/adminCenter/ticket/toGrant',
- // name: 'admin_ticket_toGrant',
- // meta: { title: '高企申报认定' },
- // component: () => import('../views/adminCenter/ticket/toGrant.vue'),
- // },
- ];
- // 企业
- const qy = [
- // 企业-基本信息
- {
- path: '/adminCenter/company/basic',
- name: 'company_basic_index',
- meta: { title: '企业基本信息' },
- component: () => import('../views/adminCenter/company/basic/index.vue'),
- },
- // 企业-信息发布
- {
- path: '/adminCenter/company/product',
- name: 'company_product_index',
- meta: { title: '信息发布' },
- component: () => import('../views/adminCenter/company/product/index.vue'),
- },
- {
- path: '/adminCenter/company/product/detail',
- name: 'company_product_index',
- meta: { title: '信息发布-信息管理' },
- component: () => import('../views/adminCenter/company/product/detail.vue'),
- },
- // 企业-创新券申领
- {
- path: '/adminCenter/company/coupons',
- name: 'company_coupons_index',
- meta: { title: '创新券' },
- component: () => import('../views/adminCenter/company/coupons/index.vue'),
- },
- {
- path: '/adminCenter/company/coupons/apply',
- name: 'company_coupons_apply',
- meta: { title: '创新券申领' },
- component: () => import('../views/adminCenter/company/coupons/apply.vue'),
- },
- {
- path: '/adminCenter/company/coupons/couponsResult',
- name: 'company_coupons_couponsResult',
- meta: { title: '创新券申领-审核结果' },
- component: () => import('../views/adminCenter/company/coupons/couponsResult.vue'),
- },
- {
- path: '/adminCenter/company/coupons/couponsResult_info',
- name: 'company_coupons_couponsResult_info',
- meta: { title: '创新券申领-审核结果查看' },
- component: () => import('../views/adminCenter/company/coupons/couponsResult_info.vue'),
- },
- // 企业-高企申报
- {
- path: '/adminCenter/company/declare',
- name: 'company_declare_index',
- meta: { title: '高企申报' },
- component: () => import('../views/adminCenter/company/declare/index.vue'),
- },
- {
- path: '/adminCenter/company/declare/detail',
- name: 'company_declare_detail',
- meta: { title: '高企申报-信息管理' },
- component: () => import('../views/adminCenter/company/declare/detail.vue'),
- },
- {
- path: '/adminCenter/company/declare/info',
- name: 'company_declare_info',
- meta: { title: '高企申报-审核结果' },
- component: () => import('../views/adminCenter/company/declare/info.vue'),
- },
- // 企业-兑付管理
- {
- path: '/adminCenter/company/cashing/coupons',
- name: 'company_cashing_coupons',
- meta: { title: '创新券兑付' },
- component: () => import('../views/adminCenter/company/cashing/coupons/index.vue'),
- },
- {
- path: '/adminCenter/company/cashing/coupons/detail',
- name: 'company_cashing_coupons_detail',
- meta: { title: '创新券兑付-申请兑付' },
- component: () => import('../views/adminCenter/company/cashing/coupons/detail.vue'),
- },
- {
- path: '/adminCenter/company/cashing/couponsResult',
- name: 'company_cashing_couponsResult',
- meta: { title: '创新券兑付' },
- component: () => import('../views/adminCenter/company/cashing/coupons/couponsResult.vue'),
- },
- // // 企业-创新券申领
- // {
- // path: '/adminCenter/company/coupons',
- // name: 'company_coupons_index',
- // meta: { title: '创新券申领' },
- // component: () => import('../views/adminCenter/company/coupons/index.vue'),
- // },
- // {
- // path: '/adminCenter/company/coupons/detail',
- // name: 'company_coupons_detail',
- // meta: { title: '创新券申领-信息管理' },
- // component: () => import('../views/adminCenter/company/coupons/detail.vue'),
- // },
- // {
- // path: '/adminCenter/company/policyApply/index',
- // name: 'company_policyApply_index',
- // meta: { title: '创新券申领-审核结果' },
- // component: () => import('../views/adminCenter/company/policy_apply/index.vue'),
- // },
- // {
- // path: '/adminCenter/company/policyApply/info',
- // name: 'company_policyApply_info',
- // meta: { title: '创新券申领-审核信息结果' },
- // component: () => import('../views/adminCenter/company/policy_apply/apply_info.vue'),
- // },
- // // 企业-服务订单
- // {
- // path: '/adminCenter/company/policyApply/order',
- // name: 'company_policyApply_order',
- // meta: { title: '服务订单' },
- // component: () => import('../views/adminCenter/company/policy_apply/order_apply.vue'),
- // },
- // {
- // path: '/adminCenter/company/policyApply/orderIndex',
- // name: 'company_policyApply_orderIndex',
- // meta: { title: '服务订单-审核结果' },
- // component: () => import('../views/adminCenter/company/policy_apply/order_index.vue'),
- // },
- ];
- // 机构
- const jg = [
- // 机构-基本信息
- {
- path: '/adminCenter/inter/basic',
- name: 'inter_basic_index',
- meta: { title: '机构基本信息' },
- component: () => import('../views/adminCenter/inter/basic/index.vue'),
- },
- // 机构-政策服务
- {
- path: '/adminCenter/inter/declare',
- name: 'inter_declare_index',
- meta: { title: '高企申报' },
- component: () => import('../views/adminCenter/inter/declare/index.vue'),
- },
- {
- path: '/adminCenter/inter/declare/detail',
- name: 'inter_declare_detail',
- meta: { title: '高企申报-信息审核' },
- component: () => import('../views/adminCenter/inter/declare/detail.vue'),
- },
- ];
- // 专家
- const zj = [
- // 专家-基本信息
- {
- path: '/adminCenter/experts/basic',
- name: 'experts_basic_index',
- meta: { title: '专家基本信息' },
- component: () => import('../views/adminCenter/experts/basic/index.vue'),
- },
- // 专家-信息发布
- {
- path: '/adminCenter/experts/product',
- name: 'experts_product_index',
- meta: { title: '信息发布' },
- component: () => import('../views/adminCenter/experts/product/index.vue'),
- },
- {
- path: '/adminCenter/experts/product/detail',
- name: 'experts_product_detail',
- meta: { title: '信息发布-信息管理' },
- component: () => import('../views/adminCenter/experts/product/detail.vue'),
- },
- ];
- const web = [
- {
- path: '/',
- name: 'index',
- meta: { title: '网站首页' },
- component: () => import('../views/index.vue'),
- },
- // 管理登录
- {
- path: '/login',
- name: 'login',
- meta: { title: '管理登录' },
- component: () => import('../views/login.vue'),
- },
- // 网址
- {
- path: '/website',
- name: 'website',
- component: () => import('../views/website.vue'),
- children: [
- {
- path: '/news/index',
- name: 'news_index',
- meta: { title: '新闻咨询' },
- component: () => import('../views/news/index.vue'),
- },
- {
- path: '/news/list',
- name: 'news_list',
- meta: { title: '新闻咨询-列表页' },
- component: () => import('../views/news/list.vue'),
- },
- {
- path: '/service/index',
- name: 'service_index',
- meta: { title: '科技服务' },
- component: () => import('../views/service/index.vue'),
- },
- {
- path: '/service/policy',
- name: 'service_policy',
- meta: { title: '科技服务-高企政策服务' },
- component: () => import('../views/service/policy.vue'),
- },
- {
- path: '/service/ticket',
- name: 'service_ticket',
- meta: { title: '科技服务-高企申报服务' },
- component: () => import('../views/service/ticket.vue'),
- },
- {
- path: '/service/register',
- name: 'service_register',
- meta: { title: '用户注册' },
- component: () => import('../views/service/register.vue'),
- },
- {
- path: '/market/index',
- name: 'market_index',
- meta: { title: '技术超市' },
- component: () => import('../views/market/index.vue'),
- },
- {
- path: '/market/list',
- name: 'market_list',
- meta: { title: '技术超市-列表页' },
- component: () => import('../views/market/list.vue'),
- },
- {
- path: '/train/index',
- name: 'train_index',
- meta: { title: '宣传培训' },
- component: () => import('../views/train/index.vue'),
- },
- {
- path: '/dynamic/index',
- name: 'dynamic_index',
- meta: { title: '数据动态' },
- component: () => import('../views/dynamic/index.vue'),
- },
- ],
- },
- // 宣传培训详情页
- {
- path: '/train/detail',
- name: 'train_detail',
- meta: { title: '宣传培训-详情页' },
- component: () => import('../views/train/detail.vue'),
- },
- // 管理中心
- {
- path: '/adminCenter/homeIndex',
- name: 'adminCenter',
- component: () => import('../views/adminCenter/index.vue'),
- children: [
- {
- path: '/adminCenter/homeIndex',
- name: 'admin_homeIndex',
- meta: { title: '首页' },
- component: () => import('../views/adminCenter/homeIndex/index.vue'),
- },
- ...fwjg,
- ...qy,
- ...jg,
- ...zj,
- ],
- },
- ];
- const routes = [...web];
- const router = new VueRouter({
- mode: 'history',
- base: process.env.VUE_APP_ROUTER,
- routes,
- });
- router.beforeEach((to, from, next) => {
- document.title = `${to.meta.title} `;
- const token = localStorage.getItem('token');
- if (to.path == '/adminCenter/homeIndex') {
- if (!token) {
- next('/login');
- } 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;
|