mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 解决应用商店同步图标丢失的问题 (#4776)
This commit is contained in:
parent
b0a3ecd3d2
commit
a40116d991
@ -728,6 +728,14 @@ func (a AppService) GetAppUpdate() (*response.AppUpdateRes, error) {
|
||||
res.CanUpdate = true
|
||||
return res, err
|
||||
}
|
||||
apps, _ := appRepo.GetBy(appRepo.WithResource(constant.AppResourceRemote))
|
||||
for _, app := range apps {
|
||||
if app.Icon == "" {
|
||||
res.CanUpdate = true
|
||||
return res, err
|
||||
}
|
||||
}
|
||||
|
||||
list, err := getAppList()
|
||||
if err != nil {
|
||||
return res, err
|
||||
@ -836,12 +844,16 @@ func (a AppService) SyncAppListFromRemote() (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer iconRes.Body.Close()
|
||||
body, err := io.ReadAll(iconRes.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
iconStr := base64.StdEncoding.EncodeToString(body)
|
||||
iconStr := ""
|
||||
if !strings.Contains(string(body), "xml") {
|
||||
iconStr = base64.StdEncoding.EncodeToString(body)
|
||||
}
|
||||
_ = iconRes.Body.Close()
|
||||
|
||||
app.Icon = iconStr
|
||||
app.TagsKey = l.AppProperty.Tags
|
||||
if l.AppProperty.Recommend > 0 {
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
mathRand "math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/app/model"
|
||||
@ -41,7 +43,7 @@ func Run() {
|
||||
if _, err := global.Cron.AddJob("@daily", job.NewSSLJob()); err != nil {
|
||||
global.LOG.Errorf("can not add ssl corn job: %s", err.Error())
|
||||
}
|
||||
if _, err := global.Cron.AddJob("@daily", job.NewAppStoreJob()); err != nil {
|
||||
if _, err := global.Cron.AddJob(fmt.Sprintf("%v %v * * *", mathRand.Intn(60), mathRand.Intn(3)), job.NewAppStoreJob()); err != nil {
|
||||
global.LOG.Errorf("can not add appstore corn job: %s", err.Error())
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,9 @@ var whiteUrlList = map[string]struct{}{
|
||||
"/api/v1/databases/variables": {},
|
||||
"/api/v1/databases/status": {},
|
||||
"/api/v1/databases/baseinfo": {},
|
||||
|
||||
"/api/v1/waf/attack/stat": {},
|
||||
"/api/v1/waf/config/website": {},
|
||||
}
|
||||
|
||||
func DemoHandle() gin.HandlerFunc {
|
||||
|
Loading…
x
Reference in New Issue
Block a user