实现自动下载升级版本

This commit is contained in:
GoEdgeLab
2023-06-13 20:52:37 +08:00
parent 05100d0ac4
commit 62d6e5bc17
13 changed files with 380 additions and 40 deletions

View File

@@ -119,7 +119,7 @@ func (this *CheckUpdatesTask) Loop() error {
var vMap = maps.NewMap(version)
if vMap.GetString("code") == "admin" {
var latestVersion = vMap.GetString("version")
if stringutil.VersionCompare(teaconst.Version, latestVersion) < 0 {
if stringutil.VersionCompare(teaconst.Version, latestVersion) < 0 && (len(config.IgnoredVersion) == 0 || stringutil.VersionCompare(latestVersion, config.IgnoredVersion) > 0) {
teaconst.NewVersionCode = latestVersion
teaconst.NewVersionDownloadURL = dlHost + vMap.GetString("url")
return nil