|
|
@@ -112,8 +112,9 @@
|
|
|
|
|
|
<script>
|
|
|
import { userVideoList } from '@/api/media/video'
|
|
|
+import { getUserInfo } from '@/api/user/account'
|
|
|
import Power from '@/utils/check-power.vue'
|
|
|
-import VideoList from '@/components/player/video-list.vue'
|
|
|
+import VideoList from '@/components/player/video-card.vue'
|
|
|
import TimeUtil from '@/utils/time-util.vue'
|
|
|
|
|
|
export default {
|
|
|
@@ -138,7 +139,7 @@ export default {
|
|
|
created() {
|
|
|
this.userId = parseInt(this.$route.params.userId)
|
|
|
this.getUserInfo()
|
|
|
- // this.getVideoList()
|
|
|
+ this.getVideoList()
|
|
|
},
|
|
|
methods: {
|
|
|
getUserInfo() {
|
|
|
@@ -146,24 +147,16 @@ export default {
|
|
|
this.userInfo = this.$store.state.user.userInfo
|
|
|
document.title = this.userInfo.username
|
|
|
} else {
|
|
|
- /* fetch(`/api/user/info/${this.userId}`, {
|
|
|
- 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.userInfo = json.data
|
|
|
- document.title = json.data.username
|
|
|
- if (json.data.id === -1) {
|
|
|
- this.$router.push('/404')
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- return null
|
|
|
- })*/
|
|
|
+ console.log('获取用户信息')
|
|
|
+ getUserInfo(this.userId).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.userInfo = res.data
|
|
|
+ } else {
|
|
|
+ alert(res.data)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error(error.message)
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
getStatusList() {
|
|
|
@@ -173,6 +166,7 @@ export default {
|
|
|
console.log('获取视频列表')
|
|
|
userVideoList(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
+ console.log(res.data)
|
|
|
for (const item of res.data.list) {
|
|
|
this.videoList.push(item)
|
|
|
}
|
|
|
@@ -184,24 +178,6 @@ export default {
|
|
|
}).catch(error => {
|
|
|
console.error(error.message)
|
|
|
})
|
|
|
-
|
|
|
- /* fetch(`/api/article/user/list/${this.userId}?page=${this.page}&limit=${this.size}&type=${this.type}`, {
|
|
|
- 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
|
|
|
- this.page = json.data.currPage
|
|
|
- this.length = json.data.totalPage
|
|
|
- this.totalCount = json.data.totalCount
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- return null
|
|
|
- })*/
|
|
|
},
|
|
|
getCommentList() {
|
|
|
console.log('获取评论列表')
|