123
This commit is contained in:
@@ -13,31 +13,41 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: '/anti/fraud',
|
path: '/anti/fraud',
|
||||||
name: 'antiFraud',
|
name: 'antiFraud',
|
||||||
title: "防骗指南",
|
meta: {
|
||||||
|
title: "防骗指南",
|
||||||
|
},
|
||||||
component: () => import(/* webpackChunkName: "about" */ '../views/AntiFraud.vue')
|
component: () => import(/* webpackChunkName: "about" */ '../views/AntiFraud.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/agreement/anchor-join',
|
path: '/agreement/anchor-join',
|
||||||
name: 'anchorJoinAgreement',
|
name: 'anchorJoinAgreement',
|
||||||
title: "主播入驻协议",
|
meta: {
|
||||||
|
title: "主播入驻协议",
|
||||||
|
},
|
||||||
component: () => import(/* webpackChunkName: "about" */ '../views/AnchorJoinAgreement.vue')
|
component: () => import(/* webpackChunkName: "about" */ '../views/AnchorJoinAgreement.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/agreement/privacy',
|
path: '/agreement/privacy',
|
||||||
name: 'privacyAgreement',
|
name: 'privacyAgreement',
|
||||||
title: "隐私协议",
|
meta: {
|
||||||
|
title: "隐私协议",
|
||||||
|
},
|
||||||
component: () => import(/* webpackChunkName: "about" */ '../views/PrivacyAgreement.vue')
|
component: () => import(/* webpackChunkName: "about" */ '../views/PrivacyAgreement.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/agreement/user',
|
path: '/agreement/user',
|
||||||
name: 'userAgreement',
|
name: 'userAgreement',
|
||||||
title: "用户协议",
|
meta: {
|
||||||
|
title: "用户协议",
|
||||||
|
},
|
||||||
component: () => import(/* webpackChunkName: "about" */ '../views/UserAgreement.vue')
|
component: () => import(/* webpackChunkName: "about" */ '../views/UserAgreement.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/share',
|
path: '/share',
|
||||||
name: 'share',
|
name: 'share',
|
||||||
title: "分享",
|
meta: {
|
||||||
|
title: "分享",
|
||||||
|
},
|
||||||
component: () => import(/* webpackChunkName: "about" */ '../views/Share.vue')
|
component: () => import(/* webpackChunkName: "about" */ '../views/Share.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -54,4 +64,15 @@ const router = new VueRouter({
|
|||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|
||||||
|
router.beforeEach((to, from, next) => {
|
||||||
|
//beforeEach是router的钩子函数,在进入路由前执行
|
||||||
|
if (to.meta.title) {
|
||||||
|
//判断是否有标题
|
||||||
|
document.title = to.meta.title
|
||||||
|
} else {
|
||||||
|
document.title = '恋香'
|
||||||
|
}
|
||||||
|
next()
|
||||||
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
queryAgreement().then(response => {
|
queryAgreement().then(response => {
|
||||||
this.agreement = response.data
|
this.agreement = response.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
queryAgreement().then(response => {
|
queryAgreement().then(response => {
|
||||||
this.agreement = response.data
|
this.agreement = response.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user