修复更新日志弹窗显示

This commit is contained in:
lyswhut
2023-02-01 12:50:38 +08:00
parent 165832e703
commit ba3b2f613a
4 changed files with 39 additions and 26 deletions
@@ -46,21 +46,27 @@ export default {
if (!versionInfo.newVersion || !versionInfo.newVersion?.history) return info
info.isLatest = compareVer(currentVer, versionInfo.newVersion.version) >= 0
for (const ver of versionInfo.newVersion.history) {
switch (compareVer(ver.version, currentVer)) {
case 0:
info.version = ver.version
info.desc = ver.desc
break
case -1:
if (lastStartVer && compareVer(lastStartVer, ver.version) < 0) info.history.push(ver)
}
}
const history = [{ version: versionInfo.newVersion.version, desc: versionInfo.newVersion.desc }, ...versionInfo.newVersion.history]
if (!info.version) {
if (currentVer == versionInfo.newVersion.version) {
info.version = versionInfo.newVersion.version
info.desc = versionInfo.newVersion.desc
if (lastStartVer) {
for (const ver of history) {
switch (compareVer(ver.version, currentVer)) {
case 0:
info.version = ver.version
info.desc = ver.desc
break
case -1:
if (compareVer(lastStartVer, ver.version) < 0) info.history.push(ver)
}
}
} else {
const verInfo = history.find(v => v.version == currentVer)
if (verInfo) {
info.version = verInfo.version
info.desc = verInfo.desc
} else {
info.desc = '未找到当前版本的更新日志'
info.version = currentVer
}
}