From 475c1d8123d8360483db91157dccdb902366c4f3 Mon Sep 17 00:00:00 2001 From: x ronger Date: Mon, 28 Sep 2020 00:52:38 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E5=85=B3=E6=B3=A8=E5=85=B3=E7=B3=BB=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/article/_article_id.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue index 270d3ea..5e7d49d 100644 --- a/pages/article/_article_id.vue +++ b/pages/article/_article_id.vue @@ -256,7 +256,8 @@ } }, mounted() { - this.$store.commit('setActiveMenu', 'articleDetail'); + let _ts = this; + _ts.$store.commit('setActiveMenu', 'articleDetail'); Vue.nextTick(() => { const previewElement = document.getElementById("articleContent"); // //const outLineElement = document.getElementById("articleToC"); @@ -276,6 +277,17 @@ //VditorPreview.outlineRender(previewElement, outLineElement); window.scrollTo(0, 0); }) + + if (_ts.user) { + _ts.$axios.$get('/api/follow/is-follow', { + params: { + followingId: _ts.article.articleAuthorId, + followingType: 0 + } + }).then(function (res) { + _ts.$set(_ts, 'isFollow', res); + }) + } } }