fix: 修复新版本小红点显示错误问题

pull/330/head
xiaojunnuo 2024-12-25 09:25:27 +08:00
parent 83185c8c50
commit fe4786e168
1 changed files with 6 additions and 3 deletions

View File

@ -143,15 +143,18 @@ const hasNewVersion = computed(() => {
if (!latestVersion.value) {
return false;
}
if (latestVersion.value === version.value) {
return false;
}
//
const current = version.value.split(".");
const latest = latestVersion.value.split(".");
for (let i = 0; i < current.length; i++) {
if (parseInt(latest[i]) > parseInt(current[i])) {
return true;
if (parseInt(latest[i]) < parseInt(current[i])) {
return false;
}
}
return false;
return true;
});
async function loadLatestVersion() {
latestVersion.value = await api.GetLatestVersion();