From e1382f96c84a6b24071c527503ba0491e3982f29 Mon Sep 17 00:00:00 2001 From: daihh Date: Tue, 31 May 2022 19:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Portal/interactBar.vue | 34 +++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/components/Portal/interactBar.vue b/src/components/Portal/interactBar.vue index 64933aca..8a6d12d1 100644 --- a/src/components/Portal/interactBar.vue +++ b/src/components/Portal/interactBar.vue @@ -238,21 +238,25 @@ export default { }) }, checkHas(){ - if(this.type>0){ - apiPraises.has(this.type,this.data.id).then(rs=>{ - if(rs.status==200 && rs.result){ - this.isPraise=true; - }else{ - this.isPraise=false; - } - }); - apiFavorites.has(this.type,this.data.id).then(rs=>{ - if(rs.status==200 && rs.result){ - this.isFavorite=true; - }else{ - this.isFavorite=false; - } - }) + if(this.type>0 && !this.readonly && this.data.id){ + if(this.favorites){ + apiFavorites.has(this.type,this.data.id).then(rs=>{ + if(rs.status==200 && rs.result){ + this.isFavorite=true; + }else{ + this.isFavorite=false; + } + }) + } + if(this.praises){ + apiPraises.has(this.type,this.data.id).then(rs=>{ + if(rs.status==200 && rs.result){ + this.isPraise=true; + }else{ + this.isPraise=false; + } + }); + } } }, addShare(){