修复更新bug

This commit is contained in:
yanran200730
2023-08-08 23:02:41 +08:00
parent 4475d8d60d
commit f4ccfe8d74
4 changed files with 22 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "TEMU助手",
"description": "TEMU助手 - 自动化提高生产效率",
"version": "0.0.1",
"version": "1.0",
"background": {
"service_worker": "/background.js"
},

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "TEMU助手",
"description": "TEMU助手 - 自动化提高生产效率",
"version": "1.0.0",
"version": "1.0",
"background": {
"service_worker": "/background.js"
},

View File

@@ -98,7 +98,7 @@
if (action === 'confirm') {
this.$http.post(isFavorite === '0' ? `/api/learning/addFavorite?id=${id}` : `/api/learning/delFavorite?id=${id}`).then(res => {
if (res.code === 0) {
this.$message.success(isFavorite === '1' ? '取消成功' : '收藏成功')
this.$message.success(isFavorite === '0' ? '收藏成功' : '取消成功')
this.getList()
}
})

View File

@@ -23,9 +23,9 @@
</ai-card>
<ai-card title="更新记录">
<div class="list">
<div class="item" v-for="(item, index) in changeLogList" :key="index" @click="info = item, isShow = true">
<div class="item" v-for="(item, index) in changeLogList" :key="index" @click="showInfo(item, index)">
<div class="left">
<el-tag v-if="version !== item.varsion" size="small" effect="dark" type="danger">新版本</el-tag>
<el-tag v-if="version !== item.version && index === 0" size="small" effect="dark" type="danger" @click.stop="download(item.downloadUrl)">新版本下载</el-tag>
<h2 :title="item.title">{{ item.title }}</h2>
</div>
<span>{{ item.createTime }}</span>
@@ -45,14 +45,15 @@
:close-on-click-modal="false"
customFooter
:show-close="!isImportant"
@close="info = {}, isShowDownload = false"
width="690">
<div class="news">
<h2>{{ info.title }}</h2>
<p>{{ info.content }}</p>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="read" type="primary" v-if="!info.varsion">{{ isImportant ? '我已阅读' : '关闭' }}{{ info.version }}</el-button>
<el-button @click="download" type="primary" style="width: 140px" v-if="info.varsion && info.varsion !== version">下载新版本</el-button>
<el-button @click="read" type="primary" style="width: 140px" v-if="!info.version">{{ isImportant ? '我已阅读' : '关闭' }}</el-button>
<el-button type="primary" style="width: 140px" v-if="info.version" @click="isShow = false">关闭</el-button>
</div>
</AiDialog>
</div>
@@ -70,7 +71,8 @@
info: {},
changeLogList: [],
isImportant: false,
version: ''
version: '',
isShowDownload: false
}
},
@@ -93,12 +95,21 @@
})
},
download () {
showInfo (info, index) {
if (index === 0) {
this.isShowDownload = true
}
this.info = info
console.log(this.info.version === this.version)
this.isShow = true
},
download (url) {
const link = document.createElement('a')
link.style.display = 'none'
link.href = this.info.downloadUrl
link.href = url
link.setAttribute('target', '_blank')
link.setAttribute('download', `TEMU助手-${this.info.varsion}.zip`)
link.setAttribute('download', `TEMU助手-${url}.zip`)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)