在star中添加key信息

This commit is contained in:
haiyangcui
2020-08-16 22:58:12 +02:00
parent 4e4ab82ea2
commit 65dcfa04ae
3 changed files with 8 additions and 7 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,