287 lines
12 KiB
JavaScript
287 lines
12 KiB
JavaScript
import Vue from 'vue'
|
|
import VueRouter from 'vue-router'
|
|
import store from '@/store';
|
|
|
|
import DefaultLayout from '@/layouts/default'
|
|
|
|
Vue.use(VueRouter)
|
|
|
|
// route level code-splitting
|
|
// this generates a separate chunk (about.[hash].js) for this route
|
|
// which is lazy-loaded when the route is visited.
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
name: 'DefaultLayout',
|
|
component: DefaultLayout,
|
|
children: [
|
|
{
|
|
path: '/',
|
|
name: 'Dashboard',
|
|
component: () => import(/* webpackChunkName: "dashboard" */ '../views/Dashboard/Dashboard.vue')
|
|
},
|
|
{
|
|
path: '/explorer',
|
|
name: 'Explorer',
|
|
component: () => import(/* webpackChunkName: "dashboard" */ '../views/Explorer/ExplorerSectionView.vue')
|
|
},
|
|
{
|
|
path: '/member/list',
|
|
name: 'MemberList',
|
|
component: () => import(/* webpackChunkName: "member" */ '../views/Member/MemberList')
|
|
},
|
|
{
|
|
path: '/member/statistics',
|
|
name: 'MemberStatistics',
|
|
component: () => import(/* webpackChunkName: "member" */ '../views/Member/MemberStatisticsView.vue')
|
|
},
|
|
{
|
|
path: '/creator/tags',
|
|
name: 'CreatorTags',
|
|
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorTags')
|
|
},
|
|
{
|
|
path: '/creator/list',
|
|
name: 'CreatorList',
|
|
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorList.vue')
|
|
},
|
|
{
|
|
path: '/creator/settlement-ratio',
|
|
name: 'CreatorReview',
|
|
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorSettlementRatio.vue')
|
|
},
|
|
{
|
|
path: '/live/tags',
|
|
name: 'LiveTags',
|
|
component: () => import(/* webpackChunkName: "live" */ '../views/Live/LiveTags.vue')
|
|
},
|
|
{
|
|
path: '/live/list',
|
|
name: 'LiveList',
|
|
component: () => import(/* webpackChunkName: "live" */ '../views/Live/LiveList.vue')
|
|
},
|
|
{
|
|
path: '/live/recommend',
|
|
name: 'LiveRecommend',
|
|
component: () => import(/* webpackChunkName: "live" */ '../views/Live/LiveRecommend.vue')
|
|
},
|
|
{
|
|
path: '/content/theme',
|
|
name: 'ContentTheme',
|
|
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentTheme.vue')
|
|
},
|
|
{
|
|
path: '/content/list',
|
|
name: 'ContentList',
|
|
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentList.vue')
|
|
},
|
|
{
|
|
path: '/content/banner',
|
|
name: 'ContentMainTopBanner',
|
|
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentMainTopBanner.vue')
|
|
},
|
|
{
|
|
path: '/content/curation',
|
|
name: 'ContentCuration',
|
|
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentCuration.vue')
|
|
},
|
|
{
|
|
path: '/content/curation/detail',
|
|
name: 'ContentCurationDetail',
|
|
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentCurationDetail.vue')
|
|
},
|
|
{
|
|
path: '/content/tag/curation',
|
|
name: 'ContentHashTagCuration',
|
|
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentHashTagCuration.vue')
|
|
},
|
|
{
|
|
path: '/content/tag/curation/detail',
|
|
name: 'ContentHashTagCurationDetail',
|
|
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentHashTagCurationDetail.vue')
|
|
},
|
|
{
|
|
path: '/content/series/list',
|
|
name: 'ContentSeriesList',
|
|
component: () => import(/* webpackChunkName: "series" */ '../views/Series/ContentSeriesList.vue')
|
|
},
|
|
{
|
|
path: '/content/series/genre',
|
|
name: 'ContentSeriesGenre',
|
|
component: () => import(/* webpackChunkName: "series" */ '../views/Series/ContentSeriesGenre.vue')
|
|
},
|
|
{
|
|
path: '/content/series/new',
|
|
name: 'ContentSeriesNew',
|
|
component: () => import(/* webpackChunkName: "series" */ '../views/Series/ContentSeriesNew.vue')
|
|
},
|
|
{
|
|
path: '/content/series/recommend-free',
|
|
name: 'ContentSeriesRecommendFree',
|
|
component: () => import(/* webpackChunkName: "series" */ '../views/Series/ContentSeriesRecommendFree.vue')
|
|
},
|
|
{
|
|
path: '/promotion/event',
|
|
name: 'EventView',
|
|
component: () => import(/* webpackChunkName: "promotion" */ '../views/Promotion/EventView.vue')
|
|
},
|
|
{
|
|
path: '/promotion/push',
|
|
name: 'Push',
|
|
component: () => import(/* webpackChunkName: "promotion" */ '../views/Promotion/Push.vue')
|
|
},
|
|
{
|
|
path: '/promotion/charge-event',
|
|
name: 'ChargeEvent',
|
|
component: () => import(/* webpackChunkName: "promotion" */ '../views/Promotion/ChargeEvent.vue')
|
|
},
|
|
{
|
|
path: '/promotion/point-policy',
|
|
name: 'PointPolicyView',
|
|
component: () => import(/* webpackChunkName: "promotion" */ '../views/Promotion/PointPolicyView.vue')
|
|
},
|
|
{
|
|
path: '/can/management',
|
|
name: 'CoinView',
|
|
component: () => import(/* webpackChunkName: "coin" */ '../views/Can/CanManagement.vue')
|
|
},
|
|
{
|
|
path: '/can/charge',
|
|
name: 'CoinCharge',
|
|
component: () => import(/* webpackChunkName: "coin" */ '../views/Can/CanCharge.vue')
|
|
},
|
|
{
|
|
path: '/can/status',
|
|
name: 'CoinStatus',
|
|
component: () => import(/* webpackChunkName: "coin" */ '../views/Can/CanStatus.vue')
|
|
},
|
|
{
|
|
path: '/can/coupon',
|
|
name: 'CanCoupon',
|
|
component: () => import(/* webpackChunkName: "coin" */ '../views/Can/CanCoupon.vue')
|
|
},
|
|
{
|
|
path: '/can/signature',
|
|
name: 'CanSignature',
|
|
component: () => import(/* webpackChunkName: "coin" */ '../views/Can/CanSignature.vue')
|
|
},
|
|
{
|
|
path: '/calculate/live',
|
|
name: 'CalculateLive',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateLive.vue')
|
|
},
|
|
{
|
|
path: '/calculate/content-by-date',
|
|
name: 'CalculateContent',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateContent.vue')
|
|
},
|
|
{
|
|
path: '/calculate/content-accumulation',
|
|
name: 'CalculateAccumulation',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateAccumulation.vue')
|
|
},
|
|
{
|
|
path: '/calculate/content-donation-by-date',
|
|
name: 'CalculateContentDonation',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateContentDonation.vue')
|
|
},
|
|
{
|
|
path: '/calculate/community-post',
|
|
name: 'CalculateCommunityPost',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateCommunityPost.vue')
|
|
},
|
|
{
|
|
path: '/calculate/live-by-creator',
|
|
name: 'CalculateLiveByCreator',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateLiveByCreator.vue')
|
|
},
|
|
{
|
|
path: '/calculate/content-by-creator',
|
|
name: 'CalculateContentByCreator',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateContentByCreator.vue')
|
|
},
|
|
{
|
|
path: '/calculate/community-by-creator',
|
|
name: 'CalculateCommunityByCreator',
|
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateCommunityByCreator.vue')
|
|
},
|
|
{
|
|
path: '/notice',
|
|
name: 'NoticeView',
|
|
component: () => import(/* webpackChunkName: "support" */ '../views/Support/NoticeView.vue')
|
|
},
|
|
{
|
|
path: '/faq',
|
|
name: 'FaqView',
|
|
component: () => import(/* webpackChunkName: "support" */ '../views/Support/FaqView.vue')
|
|
},
|
|
{
|
|
path: '/report',
|
|
name: 'ReportView',
|
|
component: () => import(/* webpackChunkName: "support" */ '../views/Support/ReportView.vue')
|
|
},
|
|
{
|
|
path: '/terms',
|
|
name: 'TermsOfServiceView',
|
|
component: () => import(/* webpackChunkName: "support" */ '../views/Support/TermsOfServiceView.vue')
|
|
},
|
|
{
|
|
path: '/privacy',
|
|
name: 'PrivacyView',
|
|
component: () => import(/* webpackChunkName: "support" */ '../views/Support/PrivacyView.vue')
|
|
},
|
|
{
|
|
path: '/audition',
|
|
name: 'AuditionView',
|
|
component: () => import(/* webpackChunkName: "audition" */ '../views/Audition/AuditionView.vue')
|
|
},
|
|
{
|
|
path: '/audition/detail',
|
|
name: 'AuditionDetailView',
|
|
component: () => import(/* webpackChunkName: "audition" */ '../views/Audition/AuditionDetailView.vue')
|
|
},
|
|
{
|
|
path: '/audition/role/detail',
|
|
name: 'AuditionRoleDetailView',
|
|
component: () => import(/* webpackChunkName: "audition" */ '../views/Audition/AuditionRoleDetailView.vue')
|
|
},
|
|
{
|
|
path: '/marketing/media-partner-code',
|
|
name: 'MarketingMediaPartnerCodeView',
|
|
component: () => import(/* webpackChunkName: "marketing" */ '../views/Marketing/MarketingMediaPartnerCodeView.vue')
|
|
},
|
|
{
|
|
path: '/marketing/ad-statistics',
|
|
name: 'MarketingAdStatisticsView',
|
|
component: () => import(/* webpackChunkName: "marketing" */ '../views/Marketing/MarketingAdStatisticsView.vue')
|
|
},
|
|
]
|
|
},
|
|
{
|
|
path: '/login',
|
|
name: 'Login',
|
|
component: () => import(/* webpackChunkName: "login" */ '../views/login/Login.vue')
|
|
},
|
|
]
|
|
|
|
const router = new VueRouter({
|
|
mode: 'history',
|
|
base: process.env.BASE_URL,
|
|
routes
|
|
})
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
if (to.path !== '/login') {
|
|
const isAuthenticated = store.getters['accountStore/isAuthenticated']
|
|
if (isAuthenticated) {
|
|
next();
|
|
} else {
|
|
next('/login?redirect=' + to.fullPath)
|
|
}
|
|
} else {
|
|
next()
|
|
}
|
|
})
|
|
|
|
export default router
|