From f24bdbb1dc2830c475cd5a8c8c59758538510466 Mon Sep 17 00:00:00 2001 From: Zeeland <287017217@qq.com> Date: Tue, 1 Nov 2022 02:27:57 +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 bb5b231..de12a55 100644 --- a/pages/admin/articles.vue +++ b/pages/admin/articles.vue @@ -157,18 +157,12 @@ export default { idArticle: idArticle, articlePerfect: '1' }).then(function (res) { - if (res) { - if (res.success) { - _ts.$store.commit('admin/updateArticlePreference', { - index: index, - idArticle: idArticle, - articlePerfect: '1' - }) - _ts.$message.success("设置成功!"); - } else { - _ts.$message.error(_ts.message); - } - } + _ts.$store.commit('admin/updateArticlePreference', { + index: index, + idArticle: idArticle, + articlePerfect: '1' + }) + _ts.$message.success("设置成功!"); }) }, cancelPreference(index, idArticle) { diff --git a/pages/admin/dashboard.vue b/pages/admin/dashboard.vue index 5228568..45fc794 100644 --- a/pages/admin/dashboard.vue +++ b/pages/admin/dashboard.vue @@ -503,18 +503,12 @@ export default { idArticle: idArticle, articlePerfect: '1' }).then(function (res) { - if (res) { - if (res.success) { - _ts.$store.commit('admin/updateArticlePreference', { - index: index, - idArticle: idArticle, - articlePerfect: '1' - }) - _ts.$message.success("设置成功!"); - } else { - _ts.$message.error(_ts.message); - } - } + _ts.$store.commit('admin/updateArticlePreference', { + index: index, + idArticle: idArticle, + articlePerfect: '1' + }) + _ts.$message.success("设置成功!"); }) }, cancelPreference(index, idArticle) {