🉑 origin优化

This commit is contained in:
微凉
2021-01-11 16:53:48 +08:00
parent dcebf5257f
commit 858291876b
10 changed files with 70 additions and 43 deletions

View File

@@ -26,6 +26,6 @@ func ReadConf(config string) bool {
return false
}
log.Debugf("config:%+v",conf.Conf)
conf.Origins = strings.Split(conf.Conf.Info.SiteUrl,",")
conf.Origins = strings.Split(conf.Conf.Server.SiteUrl,",")
return true
}

View File

@@ -3,6 +3,7 @@ package bootstrap
import (
"encoding/json"
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/utils"
log "github.com/sirupsen/logrus"
"io/ioutil"
"net/http"
@@ -32,8 +33,10 @@ func CheckUpdate() {
log.Warnf("解析更新失败:%s",err.Error())
return
}
if conf.VERSION == release.TagName {
log.Infof("当前已是最新版本:%s",release.TagName)
lasted:=release.TagName[1:]
now:=conf.VERSION[1:]
if utils.VersionCompare(lasted,now) != 1 {
log.Infof("当前已是最新版本:%s",conf.VERSION)
}else {
log.Infof("发现新版本:%s",release.TagName)
log.Infof("请至'%s'获取更新.",release.HtmlUrl)