From 44fc136961358facf7c50b60376125cb206834ce Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Sun, 27 Apr 2025 15:08:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/index.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/templates/index.html b/app/templates/index.html index b39735b..696c398 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -699,12 +699,19 @@ } }, checkNewVersion() { - this.versionTips = this.version.replace('v', ''); + // 移除本地版本中的v前缀 + const localVersionClean = this.version.replace(/^v/i, ''); + + // 显示时也去掉v前缀 + this.versionTips = localVersionClean; + axios.get('https://api.github.com/repos/x1ao4/quark-auto-save-x/tags') .then(response => { - latestVersion = response.data[0].name.replace('v', ''); - console.log(`检查版本:当前 ${this.version} 最新 ${latestVersion}`); - if (latestVersion != this.version) { + const latestVersion = response.data[0].name; // GitHub的版本不带v,不需要replace + console.log(`检查版本:当前 ${localVersionClean} 最新 ${latestVersion}`); + + // 使用处理后的版本号进行比较 + if (latestVersion !== localVersionClean) { this.versionTips += ` ${latestVersion}`; } })