Browse Source

update image.js

reghao 2 years ago
parent
commit
36ec41c62e
2 changed files with 7 additions and 2 deletions
  1. 5 0
      src/api/image.js
  2. 2 2
      src/views/user/Home.vue

+ 5 - 0
src/api/image.js

@@ -9,6 +9,7 @@ const imageApi = {
   albumImageApi: '/api/content/post/image/album',
 
   albumApi: '/api/content/image/album',
+  userAlbumApi: '/api/content/image/album/user',
   collectImageApi: '/api/content/image/collect',
   imageApi: '/api/content/image',
 }
@@ -41,6 +42,10 @@ export function getUserAlbums() {
   return get(imageApi.imageAlbumApi)
 }
 
+export function getUserAlbums1(userId) {
+  return get(imageApi.userAlbumApi + '?userId=' + userId)
+}
+
 // 获取相册
 export function getAlbumImage(albumId) {
   return get(imageApi.albumImageApi + '/' + albumId)

+ 2 - 2
src/views/user/Home.vue

@@ -140,7 +140,7 @@ import ArticleCard from 'components/card/ArticleCard'
 
 import { getUserInfo, checkRelation, followUser, unfollowUser } from "@/api/user";
 import { getUserContentData, userVideoCard } from "@/api/video";
-import { getUserAlbums } from "@/api/image";
+import { getUserAlbums1 } from "@/api/image";
 import { getUserAudio } from "@/api/audio";
 import { userStatus } from "@/api/status";
 import { getArticles } from "@/api/article";
@@ -251,7 +251,7 @@ export default {
       if (this.activeName === 'video') {
         this.userVideoListWrapper(this.currentPage, this.userId)
       } else if (this.activeName === 'image') {
-        getUserAlbums(this.userId).then(res => {
+        getUserAlbums1(this.userId).then(res => {
           if (res.code === 0) {
             const resData = res.data
             if (resData.length !== 0) {