同步的时候不清除有更新标记

This commit is contained in:
haiyangcui
2020-09-02 23:04:00 +02:00
parent 6c0bd5125b
commit 54c4409311
2 changed files with 15 additions and 12 deletions

View File

@@ -144,20 +144,20 @@ export default {
year: res.year,
note: res.note
}
if (e.last === res.last) {
doc.hasUpdate = false
star.update(e.id, doc).then(res => {
var msg = `同步"${e.name}"成功, 未查询到更新。`
star.get(e.id).then(resStar => {
doc.hasUpdate = resStar.hasUpdate
var msg = ''
if (e.last === res.last) {
msg = `同步"${e.name}"成功, 未查询到更新。`
this.$message.info(msg)
})
} else {
doc.hasUpdate = true
star.update(e.id, doc).then(res => {
var msg = `同步"${e.name}"成功, 检查到更新。`
} else {
doc.hasUpdate = true
msg = `同步"${e.name}"成功, 检查到更新。`
this.$message.success(msg)
})
}
this.getStarList()
}
star.update(e.id, doc)
this.getStarList()
})
}).catch(err => {
var msg = `同步"${e.name}"失败, 请重试。`
this.$message.warning(msg, err)

View File

@@ -19,6 +19,9 @@ export default {
async remove (id) {
return await star.delete(id)
},
async get (id) {
return await star.get(id)
},
async clear () {
return await star.clear()
}