diff --git a/src/views/homepage/leavingMessage.vue b/src/views/homepage/leavingMessage.vue index 0b2d5b16..e94ca51b 100644 --- a/src/views/homepage/leavingMessage.vue +++ b/src/views/homepage/leavingMessage.vue @@ -34,7 +34,7 @@
-

{{rep.authorInfo.name}} 个性签名:不要期待,不要假想

+

{{rep.authorInfo.name}} 个性签名:{{rep.authorInfo.sign}}

{{rep.content}}

@@ -162,7 +162,7 @@ res.result.list.forEach(item=>{ item.replysList = []; item.isReplys = false; - item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null } + item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null,sign:'' } if(item.replys != '') { item.replysList = JSON.parse(item.replys); } @@ -189,24 +189,45 @@ }) }, getUserData(list) { - let ids = list.map(item=> item.aid); - const noReapetIds = [...new Set(ids)]; - apiUser.getByIds(noReapetIds).then(res => { - if (res.status == 200) { - list.forEach((item, index) => { - res.result.some(author => { - if (author.aid == item.aid) { - item.authorInfo = author; - return true; - } else { - return false; - } - }); - }); - } else { - this.$message.error(res.message); - } - }); + if(this.pageId == this.userInfo.aid) { + let ids = list.map(item=> item.aid); + const noReapetIds = [...new Set(ids)]; + apiUser.getByIds(noReapetIds).then(res => { + if (res.status == 200) { + list.forEach((item, index) => { + res.result.some(author => { + if (author.aid == item.aid) { + item.authorInfo = author; + return true; + } else { + return false; + } + }); + }); + } else { + this.$message.error(res.message); + } + }); + } else { + let ids = list.map(item=> item.sysCreateAid); + const noReapetIds = [...new Set(ids)]; + apiUser.getByIds(noReapetIds).then(res => { + if (res.status == 200) { + list.forEach((item, index) => { + res.result.some(author => { + if (author.aid == item.sysCreateAid) { + item.authorInfo = author; + return true; + } else { + return false; + } + }); + }); + } else { + this.$message.error(res.message); + } + }); + } }, handleSizeChange(val) { this.page.pageSize = val;