From cceed9c2ea1d015297daf4d7c0ff8d52d51122ff Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:42:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=94=E7=94=A8=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=20(#3162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_install.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index 3efe534ab..1296889cd 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -8,6 +8,7 @@ import ( "os" "path" "reflect" + "sort" "strconv" "strings" @@ -505,6 +506,9 @@ func (a *AppInstallService) GetUpdateVersions(installId uint) ([]dto.AppVersion, }) } } + sort.Slice(versions, func(i, j int) bool { + return common.CompareVersion(versions[i].Version, versions[j].Version) + }) return versions, nil }