You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.9 KiB

import Vue from 'vue';
import VueRouter from 'vue-router';
import store from '../store';
import HomeView from '../views/HomeView.vue';
// import UserPosts from '../views/UserPosts.vue';
// import Franchise from '../views/Franchise.vue'
5 months ago
Vue.use(VueRouter)
const whiteSlideList = ['/', '/ui', '/siteList']; //侧边导航白名单
const whiteHeaderList = ['/', '/ui', '/register', '/configureServicePrices', '/siteList','/siteSetting/siteBaseSetting','/siteSetting/sitePersonalization'
,'/siteSetting/siteH5','/siteSetting/siteSem','/pageTemplete','/demo',
'/super/ranking/yearProfit', '/super/ranking/monthProfit', '/super/ranking/checkProfit', '/super/ranking/checkOrdernum',
'/super/ranking/checkRefund', '/super/ranking/agentProfit', '/super/ranking/agentRecharge', '/super/ranking/agentNew',
2 months ago
'/super/ranking/purchase','/super/ranking/stagePurchase','/super/ranking/loss'
]; //头部导航白名单
const whiteFooterList = ['/', '/ui', '/configureServicePrices',
'/super/ranking/yearProfit', '/super/ranking/monthProfit', '/super/ranking/checkProfit', '/super/ranking/checkOrdernum',
'/super/ranking/checkRefund', '/super/ranking/agentProfit', '/super/ranking/agentRecharge', '/super/ranking/agentNew',
2 months ago
'/super/ranking/purchase','/super/ranking/stagePurchase','/super/ranking/loss'
]; //底部白名单
const routes = [{
5 months ago
path: '/',
name: '首页',
component: HomeView,
// component: Franchise
5 months ago
},
1 month ago
// {
// path: '/register',
// name: 'register',
// component: () => import( /* webpackChunkName: "register" */ '../views/Register.vue'),
// children: [
// ]
// },
{
path: '/ui',
name: 'ui组件',
component: () => import( /* webpackChunkName: "ui" */ '../views/elementGroups.vue')
},
{
path: '/super/ranking',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/Ranking.vue'),
children: [
{
path: 'checkProfit',
3 months ago
name: '产品毛利润排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankBatchList.vue'),
props: {pageTitle:'产品 - 毛利润排行', rank_type: 1, type: 'check_type'}
},
]
},
5 months ago
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
router.beforeEach((to, from, next) => {
console.log(to.path, 'to.path-----');
if (whiteSlideList.includes(to.path)) {
store.commit('SET_SIDEBAR', true); // 登录页面不显示侧边栏
} else {
store.commit('SET_SIDEBAR', false); // 其他页面显示侧边栏
}
if (whiteFooterList.includes(to.path)) {
store.commit('SET_FOOTER', true); // 登录页面不显示侧边栏
} else {
store.commit('SET_FOOTER', false); // 其他页面显示侧边栏
}
if (whiteHeaderList.includes(to.path)) {
store.commit('SET_HEADER', true); // 登录页面不显示侧边栏
} else {
store.commit('SET_HEADER', false); // 其他页面显示侧边栏
}
next();
});
5 months ago
export default router