From 6d840142ff28a17d5e713b20e4f3c5e4704c18a8 Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 27 Apr 2021 21:39:56 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E9=89=B4=E6=9D=83=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 --- pages/portfolio/manager/_portfolio_id.vue | 11 +- pages/portfolio/post/_portfolio_id.vue | 179 +++++++++++++--------- 2 files changed, 113 insertions(+), 77 deletions(-) diff --git a/pages/portfolio/manager/_portfolio_id.vue b/pages/portfolio/manager/_portfolio_id.vue index d1826f3..621d82e 100644 --- a/pages/portfolio/manager/_portfolio_id.vue +++ b/pages/portfolio/manager/_portfolio_id.vue @@ -35,13 +35,22 @@ - + + + + + diff --git a/pages/portfolio/post/_portfolio_id.vue b/pages/portfolio/post/_portfolio_id.vue index 3dc8fdc..9cdc3d0 100644 --- a/pages/portfolio/post/_portfolio_id.vue +++ b/pages/portfolio/post/_portfolio_id.vue @@ -1,84 +1,95 @@ @@ -112,6 +123,19 @@ export default { portfolioDetail: state => state.portfolio.detail.data, uploadHeaders: state => { return {'X-Upload-Token': state.uploadHeaders} + }, + isAuthor() { + let account = this.$store.state.userInfo?.nickname; + if (account) { + if (this.$route.params.portfolio_id) { + if (account === this.portfolioDetail.portfolioAuthorName) { + return true; + } + } else { + return true; + } + } + return false; } }), idPortfolio() { @@ -366,6 +390,9 @@ export default { window.onbeforeunload = null; }, mounted() { + if (!this.isAuthor) { + return + } window.addEventListener('beforeunload', e => { e = e || window.event;