From ce2ff27f8f9b51c5aa6db7d24ac1727d04b91b91 Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 11 Aug 2020 14:41:48 +0800 Subject: [PATCH] =?UTF-8?q?:bugs:=20=E5=A4=B4=E5=83=8F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=8F=8A=E6=98=B5=E7=A7=B0=E8=8E=B7=E5=8F=96=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/widget/share.vue | 2 +- pages/article/_article_id.vue | 4 ++-- pages/draft/_draft_id.vue | 4 ++-- pages/portfolio/_portfolio_id.vue | 4 ++-- pages/portfolio/manager/_portfolio_id.vue | 8 +++++++- pages/portfolio/post/_portfolio_id.vue | 4 ++-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/components/widget/share.vue b/components/widget/share.vue index 98eea73..77ab78f 100644 --- a/components/widget/share.vue +++ b/components/widget/share.vue @@ -41,7 +41,7 @@ }, methods: { share(url) { - let path = url + '?s=' + this.$store.state.oauth.nickname + let path = url + '?s=' + this.$store.state.userInfo?.nickname return path; } } diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue index f53a3de..d7526a7 100644 --- a/pages/article/_article_id.vue +++ b/pages/article/_article_id.vue @@ -102,10 +102,10 @@ isFetching: state => state.article.detail.fetching, isMobile: state => state.global.isMobile, user: state => state.oauth, - avatar: state => state.oauth?.avatarURL + avatar: state => state.userInfo?.avatarURL }), hasPermissions() { - let account = this.$store.state.oauth?.nickname; + let account = this.$store.state.userInfo?.nickname; if (account) { if (account === this.article.articleAuthor.userNickname) { return true; diff --git a/pages/draft/_draft_id.vue b/pages/draft/_draft_id.vue index f9ad7bc..176f8e1 100644 --- a/pages/draft/_draft_id.vue +++ b/pages/draft/_draft_id.vue @@ -89,10 +89,10 @@ isFetching: state => state.draft.detail.fetching, isMobile: state => state.global.isMobile, user: state => state.oauth, - avatar: state => state.oauth?.avatarURL + avatar: state => state.userInfo?.avatarURL }), hasPermissions() { - let account = this.$store.state.oauth?.nickname; + let account = this.$store.state.userInfo?.nickname; if (account) { if (account === this.article?.articleAuthor?.userNickname) { return true; diff --git a/pages/portfolio/_portfolio_id.vue b/pages/portfolio/_portfolio_id.vue index 55946a6..22a23f0 100644 --- a/pages/portfolio/_portfolio_id.vue +++ b/pages/portfolio/_portfolio_id.vue @@ -61,10 +61,10 @@ isFetching: state => state.portfolio.detail.fetching, isMobile: state => state.global.isMobile, user: state => state.oauth, - avatar: state => state.oauth?.avatarURL + avatar: state => state.userInfo?.avatarURL }), isAuthor() { - let account = this.$store.state.oauth?.nickname; + let account = this.$store.state.userInfo?.nickname; if (account) { if (account === this.portfolio.portfolioAuthor.userNickname) { return true; diff --git a/pages/portfolio/manager/_portfolio_id.vue b/pages/portfolio/manager/_portfolio_id.vue index 8a6c48f..6fd7ba7 100644 --- a/pages/portfolio/manager/_portfolio_id.vue +++ b/pages/portfolio/manager/_portfolio_id.vue @@ -69,7 +69,7 @@ portfolio: state => state.portfolio.detail.data }), isAuthor() { - let account = this.$store.state.oauth?.nickname; + let account = this.$store.state.userInfo?.nickname; if (account) { if (account === this.portfolio.portfolioAuthorName) { return true; @@ -84,6 +84,12 @@ this.$router.push({ path: data }) + } else if (name === 'user') { + this.$router.push( + { + path: '/user/' + data + } + ) } else { this.$router.push( { diff --git a/pages/portfolio/post/_portfolio_id.vue b/pages/portfolio/post/_portfolio_id.vue index eb8cc44..9398a9c 100644 --- a/pages/portfolio/post/_portfolio_id.vue +++ b/pages/portfolio/post/_portfolio_id.vue @@ -2,7 +2,7 @@ - {{ portfolio.portfolioTitle }} + {{ portfolio.portfolioTitle }} 更新作品集 @@ -259,7 +259,7 @@ _ts.$message(res.message); } else { _ts.$router.push({ - path: '/user/' + _ts.$store.state.oauth.nickname + path: '/user/' + _ts.$store.state.userInfo?.nickname }) } }