|
@@ -35,16 +35,7 @@
|
|
|
>
|
|
>
|
|
|
<span style="cursor:pointer" @click="goToHome()">{{ this.$store.state.webInfo.name }}</span>
|
|
<span style="cursor:pointer" @click="goToHome()">{{ this.$store.state.webInfo.name }}</span>
|
|
|
</v-toolbar-title>
|
|
</v-toolbar-title>
|
|
|
-
|
|
|
|
|
- <!--<v-text-field
|
|
|
|
|
- v-model="keyword"
|
|
|
|
|
- flat
|
|
|
|
|
- solo-inverted
|
|
|
|
|
- hide-details
|
|
|
|
|
- prepend-inner-icon="mdi-magnify"
|
|
|
|
|
- label="搜索"
|
|
|
|
|
- />-->
|
|
|
|
|
- <SearchInput/>
|
|
|
|
|
|
|
+ <SearchInput />
|
|
|
<v-spacer />
|
|
<v-spacer />
|
|
|
<v-tooltip bottom>
|
|
<v-tooltip bottom>
|
|
|
<template v-slot:activator="{ on, attrs }">
|
|
<template v-slot:activator="{ on, attrs }">
|
|
@@ -81,7 +72,6 @@
|
|
|
<v-icon left dark>mdi-account</v-icon> 登录
|
|
<v-icon left dark>mdi-account</v-icon> 登录
|
|
|
</v-btn>
|
|
</v-btn>
|
|
|
</v-app-bar>
|
|
</v-app-bar>
|
|
|
-
|
|
|
|
|
<v-main>
|
|
<v-main>
|
|
|
<router-view />
|
|
<router-view />
|
|
|
</v-main>
|
|
</v-main>
|
|
@@ -102,7 +92,6 @@ import Head from '@/layout/components/head.vue'
|
|
|
import SearchInput from '@/layout/components/search-input.vue'
|
|
import SearchInput from '@/layout/components/search-input.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- // TODO 增加分类页
|
|
|
|
|
components: {
|
|
components: {
|
|
|
Head,
|
|
Head,
|
|
|
SearchInput
|
|
SearchInput
|
|
@@ -116,15 +105,13 @@ export default {
|
|
|
{ icon: 'mdi-history', text: '分区', link: '/channel' },
|
|
{ icon: 'mdi-history', text: '分区', link: '/channel' },
|
|
|
{ icon: 'mdi-youtube-subscription', text: '直播', link: '/live' },
|
|
{ icon: 'mdi-youtube-subscription', text: '直播', link: '/live' },
|
|
|
{ icon: 'mdi-trending-up', text: '微博', link: '/mblog' },
|
|
{ icon: 'mdi-trending-up', text: '微博', link: '/mblog' },
|
|
|
- { icon: 'mdi-trending-up', text: '知乎', link: '/zhihu' },
|
|
|
|
|
- { icon: 'mdi-playlist-play', text: '稍后再看', link: '/playlist' }
|
|
|
|
|
-
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ { icon: 'mdi-trending-up', text: '知乎', link: '/zhihu' }
|
|
|
|
|
+ ]/*,
|
|
|
headItem: [
|
|
headItem: [
|
|
|
- { icon: 'mdi-head', text: '个人中心', link: '/studio', id: 0 },
|
|
|
|
|
|
|
+ { icon: 'mdi-head', text: '个人中心', link: '/user/:userId', id: 0 },
|
|
|
{ icon: 'mdi-wrench', text: '创作中心', link: '/studio', id: 1 },
|
|
{ icon: 'mdi-wrench', text: '创作中心', link: '/studio', id: 1 },
|
|
|
{ icon: 'mdi-logout', text: '退出', link: '/logout', id: 2 }
|
|
{ icon: 'mdi-logout', text: '退出', link: '/logout', id: 2 }
|
|
|
- ]
|
|
|
|
|
|
|
+ ]*/
|
|
|
}),
|
|
}),
|
|
|
mounted() {
|
|
mounted() {
|
|
|
},
|
|
},
|
|
@@ -133,7 +120,7 @@ export default {
|
|
|
this.$vuetify.theme.dark = this.$store.state.darkThemOpen
|
|
this.$vuetify.theme.dark = this.$store.state.darkThemOpen
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- headClick(value) {
|
|
|
|
|
|
|
+ /* headClick(value) {
|
|
|
if (value === 0) {
|
|
if (value === 0) {
|
|
|
this.$router.push('/user/' + this.userInfo.userId)
|
|
this.$router.push('/user/' + this.userInfo.userId)
|
|
|
} else if (value === 1) {
|
|
} else if (value === 1) {
|
|
@@ -141,7 +128,7 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
this.logout()
|
|
this.logout()
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
|
|
+ },*/
|
|
|
logout() {
|
|
logout() {
|
|
|
// 调用 store/modules/user.js 中的 login 方法
|
|
// 调用 store/modules/user.js 中的 login 方法
|
|
|
this.$store.dispatch('user/logout').then(() => {
|
|
this.$store.dispatch('user/logout').then(() => {
|
|
@@ -153,30 +140,6 @@ export default {
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
console.log('用户登录失败')
|
|
console.log('用户登录失败')
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
- /* 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
|
|
|
|
|
- })*/
|
|
|
|
|
},
|
|
},
|
|
|
goToLoginPage() {
|
|
goToLoginPage() {
|
|
|
this.$router.push('/login')
|
|
this.$router.push('/login')
|