123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- import Vue from 'vue';
- import VueRouter from 'vue-router';
- import store from '@/store/index';
- Vue.use(VueRouter);
- const routes = [
- // 首页
- {
- path: '/',
- name: '',
- meta: { title: '首页', isleftarrow: false },
- component: () => import('../views/home/index.vue'),
- },
- // 直播大厅
- {
- path: '/live/index',
- name: 'live_index',
- meta: { title: '直播大厅', isleftarrow: true },
- component: () => import('../views/live/index.vue'),
- },
- // 科技超市
- {
- path: '/market/index',
- name: 'market_index',
- meta: { title: '科技超市', isleftarrow: true },
- component: () => import('../views/market/index.vue'),
- },
- // 科技超市-技术-产品-服务详情
- {
- path: '/market/prodDetail',
- name: 'market_prodDetail',
- meta: { title: '产品详情', isleftarrow: true },
- component: () => import('../views/market/prodDetail.vue'),
- },
- // 科技超市-专家详情
- {
- path: '/market/exportDetail',
- name: 'market_exportDetail',
- meta: { title: '专家详情', isleftarrow: true },
- component: () => import('../views/market/exportDetail.vue'),
- },
- // 科技超市-发布产品
- {
- path: '/market/detail',
- name: 'market_detail',
- meta: { title: '发布产品', isleftarrow: true },
- component: () => import('../views/market/detail.vue'),
- },
- // 我的发布
- {
- path: '/userCenter/myProduct/index',
- name: 'myProduct_index',
- meta: { title: '我的发布', isleftarrow: true },
- component: () => import('../views/userCenter/myProduct/index.vue'),
- },
- // 发布产品
- {
- path: '/detail',
- name: 'myfabu_detail',
- meta: { title: '我的发布', isleftarrow: true },
- component: () => import('../views/myfabu/detail.vue'),
- },
- // 事项管理
- // 用户-事项管理
- {
- path: '/userCenter/matter/index',
- name: 'matter_index',
- meta: { title: '事项管理', isleftarrow: true },
- component: () => import('../views/userCenter/matter/index.vue'),
- },
- // 用户-展会管理
- {
- path: '/userCenter/dock/index',
- name: 'dock_index',
- meta: { title: '事项管理', isleftarrow: true },
- component: () => import('../views/userCenter/dock/index.vue'),
- },
- // 用户-个人中心
- {
- path: '/userCenter/user/index',
- name: 'user_index',
- meta: { title: '个人中心', isleftarrow: true },
- component: () => import('../views/userCenter/user/index.vue'),
- },
- // // 个人中心
- // {
- // path: '/user/index',
- // name: 'user_index',
- // meta: { title: '个人中心', isleftarrow: true },
- // component: () => import('../views/user/index.vue'),
- // },
- ,
- ];
- const router = new VueRouter({
- mode: 'history',
- base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER,
- routes,
- });
- // router.beforeEach((to, form, next) => {
- // if (to.name === 'pcenter_center') {
- // store.commit('setUser');
- // if (to.name === 'login') {
- // next();
- // return;
- // }
- // let user = store.state.user;
- // if (user) {
- // next();
- // }
- // //下面是没登录的情况,需要跳转页面到用户未登录页
- // else next({ name: 'login' });
- // } else {
- // store.commit('setUser');
- // next();
- // }
- // });
- export default router;
|