mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
提交
This commit is contained in:
@@ -262,7 +262,7 @@ import apiUser from "@/api/system/user.js";
|
||||
})
|
||||
this.followMe.list = res.result.list;
|
||||
//console.log(this.mypageList,'this.mypageList');
|
||||
this.getUserData(res.result.list);
|
||||
this.getUserData(res.result.list,2);
|
||||
}else{
|
||||
console.log('加载关注我数据错误:'+res.message);
|
||||
}
|
||||
@@ -280,26 +280,26 @@ import apiUser from "@/api/system/user.js";
|
||||
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||
})
|
||||
this.follow.list = res.result.list;
|
||||
this.getUserData(res.result.list);
|
||||
this.getUserData(res.result.list, 1);
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserData(list) {
|
||||
// num 判断是哪个接口
|
||||
getUserData(list,num) {
|
||||
let ids = [];
|
||||
if(this.active == 2) {
|
||||
if(num == 2) {
|
||||
ids = list.map(item=> item.userFollow.aid);
|
||||
} else {
|
||||
ids = list.map(item=> item.userFollow.followId);
|
||||
}
|
||||
|
||||
apiUser.getByIds(ids).then(res => {
|
||||
if (res.status == 200) {
|
||||
list.forEach((item, index) => {
|
||||
res.result.some(author => {
|
||||
if (this.active == 1 && author.aid == item.userFollow.followId) {
|
||||
if (num == 1 && author.aid == item.userFollow.followId) {
|
||||
item.userFollow.authorInfo = author;
|
||||
return true;
|
||||
} else if(this.active == 2 && author.aid == item.userFollow.aid){
|
||||
} else if(num == 2 && author.aid == item.userFollow.aid){
|
||||
item.userFollow.authorInfo = author;
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user