|
|
@@ -36,6 +36,7 @@
|
|
|
<v-col>
|
|
|
标签:
|
|
|
<span v-for="item in videoData.tags" :key="item">
|
|
|
+ <!-- TODO 点击标签 button 时请求后端返回具有相同标签的所有视频并在新页面显示 -->
|
|
|
<v-btn rounded small text color="primary" dark>{{ item }}</v-btn>
|
|
|
</span><br>
|
|
|
<br>
|
|
|
@@ -141,6 +142,17 @@ export default {
|
|
|
colsWidth: 8
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ // TODO 监听地址栏路由,发生变化时重新加载当前页面
|
|
|
+ $route: {
|
|
|
+ handler(newName, oldName) {
|
|
|
+ console.log(newName.path)
|
|
|
+ console.log('----------------')
|
|
|
+ console.log(oldName.path)
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
// 获取 url 上的 path 参数
|
|
|
this.videoId = this.$route.params.id
|
|
|
@@ -159,28 +171,6 @@ export default {
|
|
|
this.colsWidth = 8
|
|
|
}
|
|
|
},
|
|
|
- /* videoInfo1() {
|
|
|
- fetch(`/api/media/video/post/${this.videoId}`, {
|
|
|
- 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.code === 0) {
|
|
|
- this.videoData = json.data
|
|
|
- document.title = json.data.title
|
|
|
- } else {
|
|
|
- // TODO 显示 404
|
|
|
- this.$router.push('/')
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- return null
|
|
|
- })
|
|
|
- },*/
|
|
|
// 获取视频的详细信息
|
|
|
getVideoInfo(videoId) {
|
|
|
videoInfo(videoId)
|
|
|
@@ -201,22 +191,6 @@ export default {
|
|
|
this.$message.error(error.message)
|
|
|
})
|
|
|
},
|
|
|
- /* getSimilarVideos1(videoId) {
|
|
|
- fetch(`/api/media/video/post/similar?videoId=${videoId}`, {
|
|
|
- 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 => {
|
|
|
- this.videoList = json.data.list
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- return null
|
|
|
- })
|
|
|
- },*/
|
|
|
// 获取和当前视频类似的其他视频
|
|
|
getSimilarVideos(videoId) {
|
|
|
similarVideo(videoId)
|