|
|
@@ -46,12 +46,12 @@ export default {
|
|
|
return {
|
|
|
userInfo: {},
|
|
|
headItem: [
|
|
|
- { icon: 'mdi-account', text: '个人中心', link: '/studio', id: 0 },
|
|
|
- { icon: 'mdi-application', text: '稍后再看', link: '/studio', id: 2 },
|
|
|
- { icon: 'mdi-application', text: '收藏列表', link: '/studio', id: 3 },
|
|
|
- { icon: 'mdi-application', text: '历史记录', link: '/studio', id: 4 },
|
|
|
- { icon: 'mdi-cash-usd', text: '付费会员', link: '/vip', id: 5 },
|
|
|
- { icon: 'mdi-logout', text: '退出', link: '/logout', id: 6 }
|
|
|
+ { icon: 'mdi-account', text: '个人中心', link: '/u', id: 0 },
|
|
|
+ { icon: 'mdi-application', text: '稍后再看', link: '/user/playlist', id: 1 },
|
|
|
+ { icon: 'mdi-application', text: '收藏列表', link: '/user/favlist', id: 2 },
|
|
|
+ { icon: 'mdi-application', text: '历史记录', link: '/user/hislist', id: 3 },
|
|
|
+ { icon: 'mdi-application', text: '创作中心', link: '/studio', id: 4 },
|
|
|
+ { icon: 'mdi-logout', text: '退出', link: '/logout', id: 5 }
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
@@ -61,25 +61,16 @@ export default {
|
|
|
methods: {
|
|
|
headClick(value) {
|
|
|
if (value === 0) {
|
|
|
- // this.$router.push('/user/' + this.userInfo.userId)
|
|
|
- // location.replace('/user/' + this.userInfo.userId)
|
|
|
- if (this.$route.path === '/studio') {
|
|
|
- return
|
|
|
- }
|
|
|
- this.$router.push('/studio')
|
|
|
- } else if (value === 1) {
|
|
|
- if (this.$route.path === '/studio') {
|
|
|
- return
|
|
|
- }
|
|
|
+ this.$router.push('/u/' + this.userInfo.userId)
|
|
|
+ location.replace('/u/' + this.userInfo.userId)
|
|
|
+ } else if (value === 1 && this.$route.path !== '/user/playlist') {
|
|
|
+ this.$router.push('/user/playlist')
|
|
|
+ } else if (value === 2 && this.$route.path !== '/user/favlist') {
|
|
|
+ this.$router.push('/user/favlist')
|
|
|
+ } else if (value === 3 && this.$route.path !== '/user/hislist') {
|
|
|
+ this.$router.push('/user/hislist')
|
|
|
+ } else if (value === 4 && this.$route.path !== '/user/studio') {
|
|
|
this.$router.push('/studio')
|
|
|
- } else if (value === 3) {
|
|
|
- this.$router.push('/vip')
|
|
|
- } else if (value === 4) {
|
|
|
- if (this.$route.path === '/user/setting') {
|
|
|
- return
|
|
|
- }
|
|
|
- this.$router.push('/user/setting')
|
|
|
- // location.replace('/user/setting')
|
|
|
} else {
|
|
|
this.logout()
|
|
|
}
|
|
|
@@ -95,31 +86,6 @@ export default {
|
|
|
}).catch(() => {
|
|
|
console.log('用户登录失败')
|
|
|
})
|
|
|
-
|
|
|
- /* this.$store.commit('setUserInfo', null)
|
|
|
- fetch(`/api/logout`, {
|
|
|
- headers: {
|
|
|
- 'Content-Type': 'application/json; charset=UTF-8',
|
|
|
- 'X-XSRF-TOKEN': this.$cookies.get('XSRF-TOKEN')
|
|
|
- },
|
|
|
- method: 'GET',
|
|
|
- credentials: 'include'
|
|
|
- }).then(response => response.json())
|
|
|
- .then(json => {
|
|
|
- if (json.status === 200) {
|
|
|
- this.$store.commit('setUserInfo', null)
|
|
|
- if (this.$route.path === '/') {
|
|
|
- location.reload()
|
|
|
- } else {
|
|
|
- this.$router.push('/')
|
|
|
- }
|
|
|
- } else {
|
|
|
- //
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- return null
|
|
|
- })*/
|
|
|
}
|
|
|
}
|
|
|
}
|