From 55de0b557ae32c7a4863fc715be305e6814a44a3 Mon Sep 17 00:00:00 2001 From: Zeeland <287017217@qq.com> Date: Tue, 1 Nov 2022 02:59:22 +0800 Subject: [PATCH] :fix: the preference button does not render correctly in time. --- pages/admin/articles.vue | 18 ++++++------------ pages/admin/dashboard.vue | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/pages/admin/articles.vue b/pages/admin/articles.vue index de12a55..0a0cfb3 100644 --- a/pages/admin/articles.vue +++ b/pages/admin/articles.vue @@ -171,18 +171,12 @@ export default { idArticle: idArticle, articlePerfect: '0' }).then(function (res) { - if (res) { - if (res.success) { - _ts.$store.commit('admin/updateArticlePreference', { - index: index, - idArticle: idArticle, - articlePerfect: '0' - }) - _ts.$message.success("取消成功!"); - } else { - _ts.$message.error(_ts.message); - } - } + _ts.$store.commit('admin/updateArticlePreference', { + index: index, + idArticle: idArticle, + articlePerfect: '0' + }) + _ts.$message.success("取消成功!"); }) }, updateTags(index, article) { diff --git a/pages/admin/dashboard.vue b/pages/admin/dashboard.vue index 45fc794..71090e1 100644 --- a/pages/admin/dashboard.vue +++ b/pages/admin/dashboard.vue @@ -517,18 +517,12 @@ export default { idArticle: idArticle, articlePerfect: '0' }).then(function (res) { - if (res) { - if (res.success) { - _ts.$store.commit('admin/updateArticlePreference', { - index: index, - idArticle: idArticle, - articlePerfect: '0' - }) - _ts.$message.success("取消成功!"); - } else { - _ts.$message.error(_ts.message); - } - } + _ts.$store.commit('admin/updateArticlePreference', { + index: index, + idArticle: idArticle, + articlePerfect: '0' + }) + _ts.$message.success("取消成功!"); }) }, updateTags(index, article) {