From 75c23271dfec2c455b970027fcf5776e3af2f0e1 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 8 May 2024 14:32:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7=E4=BF=A1=E6=81=AF=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#4914)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/upgrade.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/app/service/upgrade.go b/backend/app/service/upgrade.go index 6b8d243d6..db1b0f98a 100644 --- a/backend/app/service/upgrade.go +++ b/backend/app/service/upgrade.go @@ -42,10 +42,19 @@ func (u *UpgradeService) SearchUpgrade() (*dto.UpgradeInfo, error) { } upgrade.TestVersion, upgrade.NewVersion, upgrade.LatestVersion = u.loadVersionByMode(DeveloperMode.Value, currentVersion.Value) - itemVersion := upgrade.LatestVersion - if upgrade.NewVersion != "" { + var itemVersion string + if len(upgrade.LatestVersion) != 0 { + itemVersion = upgrade.LatestVersion + } + if len(upgrade.NewVersion) != 0 { itemVersion = upgrade.NewVersion } + if (global.CONF.System.Mode == "dev" || DeveloperMode.Value == "enable") && len(upgrade.TestVersion) != 0 { + itemVersion = upgrade.TestVersion + } + if len(itemVersion) == 0 { + return &upgrade, nil + } notes, err := u.loadReleaseNotes(fmt.Sprintf("%s/%s/%s/release/1panel-%s-release-notes", global.CONF.System.RepoUrl, global.CONF.System.Mode, itemVersion, itemVersion)) if err != nil { return nil, fmt.Errorf("load releases-notes of version %s failed, err: %v", itemVersion, err)