From 65dcfa04ae133ed58183aa4faab0a73382c0e922 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Sun, 16 Aug 2020 22:58:12 +0200 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8star=E4=B8=AD=E6=B7=BB=E5=8A=A0key?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail.vue | 3 ++- src/components/Film.vue | 3 ++- src/components/Play.vue | 9 ++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Detail.vue b/src/components/Detail.vue index a123ba5..23b0a97 100644 --- a/src/components/Detail.vue +++ b/src/components/Detail.vue @@ -131,11 +131,12 @@ export default { this.detail.show = false }, starEvent () { - star.find({ site: this.detail.key, ids: this.info.id }).then(res => { + star.find({ key: this.detail.site.key, ids: this.info.id }).then(res => { if (res) { this.$message.info('已存在') } else { const docs = { + key: this.detail.site.key, site: this.detail.site, ids: this.info.id, name: this.info.name, diff --git a/src/components/Film.vue b/src/components/Film.vue index c1c9c8f..11e9d15 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -300,11 +300,12 @@ export default { this.view = 'Play' }, starEvent (site, e) { - star.find({ site: site.key, ids: e.id }).then(res => { + star.find({ key: site.key, ids: e.id }).then(res => { if (res) { this.$message.info('已存在') } else { const docs = { + key: site.key, site: site, ids: e.id, name: e.name, diff --git a/src/components/Play.vue b/src/components/Play.vue index 472abe2..4263f5e 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -461,14 +461,13 @@ export default { }, starEvent () { const info = this.video.info - star.find({ site: this.video.key, ids: info.id }).then(res => { + this.$message.warning('video.key:' + this.video.key) + star.find({ key: this.video.key, ids: info.id }).then(res => { if (res) { - star.remove(res.id).then(e => { - this.$message.info('取消收藏') - this.isStar = false - }) + this.$message.info('已存在') } else { const docs = { + key: this.video.key, site: this.video.key, ids: info.id, name: info.name,