mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
fix: 修复新版本小红点显示错误问题
This commit is contained in:
@@ -143,15 +143,18 @@ const hasNewVersion = computed(() => {
|
|||||||
if (!latestVersion.value) {
|
if (!latestVersion.value) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (latestVersion.value === version.value) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//分段比较
|
//分段比较
|
||||||
const current = version.value.split(".");
|
const current = version.value.split(".");
|
||||||
const latest = latestVersion.value.split(".");
|
const latest = latestVersion.value.split(".");
|
||||||
for (let i = 0; i < current.length; i++) {
|
for (let i = 0; i < current.length; i++) {
|
||||||
if (parseInt(latest[i]) > parseInt(current[i])) {
|
if (parseInt(latest[i]) < parseInt(current[i])) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
});
|
});
|
||||||
async function loadLatestVersion() {
|
async function loadLatestVersion() {
|
||||||
latestVersion.value = await api.GetLatestVersion();
|
latestVersion.value = await api.GetLatestVersion();
|
||||||
|
|||||||
Reference in New Issue
Block a user