This commit is contained in:
yanran200730
2022-05-31 11:30:28 +08:00
parent c1ad02537a
commit 8497babbbd
2 changed files with 25 additions and 4 deletions

View File

@@ -54,6 +54,11 @@
JSON.parse(v.content).forEach((item, index) => {
msg = msg + `${item.key}${item.value}` + (JSON.parse(v.content).length === index + 1 ? '' : '')
})
} else {
msg = ''
JSON.parse(v.content).forEach((item, index) => {
msg = msg + `${item.key}${item.value}` + (JSON.parse(v.content).length === index + 1 ? '' : '')
})
}
return {
...v,
@@ -69,6 +74,11 @@
JSON.parse(v.content).forEach((item, index) => {
msg = msg + `${item.key}${item.value}` + (JSON.parse(v.content).length === index + 1 ? '' : '')
})
} else {
msg = ''
JSON.parse(v.content).forEach((item, index) => {
msg = msg + `${item.key}${item.value}` + (JSON.parse(v.content).length === index + 1 ? '' : '')
})
}
return {
...v,

View File

@@ -36,9 +36,9 @@
<div class="right-info">
<div class="right-info__news">
<span>最新</span>
<i>你于2月14日发布的你于2月14日发布的</i>
<i>{{ msgInfo.msg || '暂无消息' }}</i>
</div>
<p>2022-2-14 10:02</p>
<p>{{ msgInfo.createTime || '' }}</p>
</div>
</div>
</div>
@@ -138,7 +138,14 @@
getMsgList () {
this.$http.post('/api/sysmessage/latestnews').then(res => {
if (res.code === 0) {
this.msgInfo = res.data
if (res.data) {
let msg = ''
JSON.parse(res.data.content).forEach((item, index) => {
msg = msg + `${item.key}${item.value}` + (JSON.parse(res.data.content).length === index + 1 ? '' : '')
})
this.msgInfo = res.data
this.msgInfo.msg = msg
}
}
})
},
@@ -370,7 +377,7 @@
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 40px;
margin-bottom: 26px;
.right-top__left {
width: 136px;
@@ -385,6 +392,10 @@
.right-info {
.right-info__news {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
margin-bottom: 12px;
span {