diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue
index e0d5e32..1d8350c 100644
--- a/pages/article/_article_id.vue
+++ b/pages/article/_article_id.vue
@@ -44,7 +44,7 @@
-
+
取消关注
关注
@@ -139,7 +139,7 @@
+ :post-id="routeArticleId" :authorId="article.articleAuthorId" @gotoLogin="gotoLogin">
@@ -249,7 +249,6 @@ export default {
loading: false,
isShare: false,
dialogVisible: false,
- isFollow: false,
isPerfect: false,
shareData: {}
}
@@ -308,6 +307,7 @@ export default {
followingType: 0
}).then(function (res) {
_ts.$set(_ts, 'isFollow', res);
+ _ts.$store.dispatch('follow/fetchUserFollowingList');
})
} else {
_ts.gotoLogin();
@@ -321,6 +321,7 @@ export default {
followingType: 0
}).then(function (res) {
_ts.$set(_ts, 'isFollow', res);
+ _ts.$store.dispatch('follow/fetchUserFollowingList');
})
} else {
_ts.gotoLogin();
@@ -388,6 +389,9 @@ export default {
}
}
})
+ },
+ isFollower(idUser) {
+ return this.$store.getters["follow/isFollower"](idUser)
}
},
mounted() {
@@ -417,17 +421,6 @@ export default {
});
_ts.$set(_ts, 'isPerfect', _ts.article.articlePerfect === '1')
})
-
- 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);
- })
- }
}
}
diff --git a/pages/user/_account.vue b/pages/user/_account.vue
index 50ffddf..ef39d54 100644
--- a/pages/user/_account.vue
+++ b/pages/user/_account.vue
@@ -79,10 +79,10 @@
-
+
-
+
@@ -202,7 +202,6 @@ export default {
this.$router.push({
path: `/user/${this.$route.params.account}?tab=${key}&page=${page}`
})
-
},
gotoChats() {
let _ts = this;
@@ -218,6 +217,7 @@ export default {
followingType: 0
}).then(function (res) {
_ts.$set(_ts, 'isFollow', res);
+ _ts.$store.dispatch('follow/fetchUserFollowingList');
})
} else {
_ts.login()
@@ -231,6 +231,7 @@ export default {
followingType: 0
}).then(function (res) {
_ts.$set(_ts, 'isFollow', res);
+ _ts.$store.dispatch('follow/fetchUserFollowingList');
})
} else {
_ts.login()