diff --git a/gan-ui/src/views/app/dynamic/index.vue b/gan-ui/src/views/app/dynamic/index.vue index ae8e5e7..1a25b47 100644 --- a/gan-ui/src/views/app/dynamic/index.vue +++ b/gan-ui/src/views/app/dynamic/index.vue @@ -71,10 +71,11 @@ @@ -332,13 +333,18 @@ export default { ); }, handleStatusChange(row) { - let text = row.isTop === "0" ? "置顶" : "取消"; - this.$modal.confirm('确认要"' + text + '""' + row.username + '"的动态吗?').then(function() { + let text = row.isTop ? "取消" : "置顶"; + + this.$modal.confirm('确认要"' + text + '""' + row.username + '"的动态置顶吗?').then(function() { return changeDynamicStatus(row.id, row.isTop); }).then(() => { this.$modal.msgSuccess(text + "成功"); }).catch(function() { - row.isTop = row.isTop === "0" ? "1" : "0"; + if (row.isTop) { + row.isTop = row.isTop ? !row.isTop : row.isTop; + }else { + row.isTop = row.isTop ? row.isTop : !row.isTop; + } }); }, },