mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 12:26: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;
|
this.followMe.list = res.result.list;
|
||||||
//console.log(this.mypageList,'this.mypageList');
|
//console.log(this.mypageList,'this.mypageList');
|
||||||
this.getUserData(res.result.list);
|
this.getUserData(res.result.list,2);
|
||||||
}else{
|
}else{
|
||||||
console.log('加载关注我数据错误:'+res.message);
|
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:''}
|
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||||
})
|
})
|
||||||
this.follow.list = res.result.list;
|
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 = [];
|
let ids = [];
|
||||||
if(this.active == 2) {
|
if(num == 2) {
|
||||||
ids = list.map(item=> item.userFollow.aid);
|
ids = list.map(item=> item.userFollow.aid);
|
||||||
} else {
|
} else {
|
||||||
ids = list.map(item=> item.userFollow.followId);
|
ids = list.map(item=> item.userFollow.followId);
|
||||||
}
|
}
|
||||||
|
|
||||||
apiUser.getByIds(ids).then(res => {
|
apiUser.getByIds(ids).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
res.result.some(author => {
|
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;
|
item.userFollow.authorInfo = author;
|
||||||
return true;
|
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;
|
item.userFollow.authorInfo = author;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user