solve the first time app store opening failure problem
This commit is contained in:
parent
d3f78b52fa
commit
3a60db3729
1 changed files with 8 additions and 7 deletions
|
@ -127,13 +127,13 @@ func (o *casaService) GetServerList(index, size, tp, categoryId, key string) (mo
|
||||||
func (o *casaService) AsyncGetServerList() (collection model.ServerAppListCollection, err error) {
|
func (o *casaService) AsyncGetServerList() (collection model.ServerAppListCollection, err error) {
|
||||||
|
|
||||||
results := file.ReadFullFile(config.AppInfo.DBPath + "/app_list.json")
|
results := file.ReadFullFile(config.AppInfo.DBPath + "/app_list.json")
|
||||||
err = json2.Unmarshal(results, &collection)
|
errr := json2.Unmarshal(results, &collection)
|
||||||
if err != nil {
|
if errr != nil {
|
||||||
loger.Error("marshal error", zap.Any("err", err), zap.Any("content", string(results)))
|
loger.Error("marshal error", zap.Any("err", err), zap.Any("content", string(results)))
|
||||||
}
|
} else {
|
||||||
|
if collection.Version == o.GetCasaosVersion().Version {
|
||||||
if collection.Version == o.GetCasaosVersion().Version {
|
return collection, err
|
||||||
return collection, err
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
head := make(map[string]string)
|
head := make(map[string]string)
|
||||||
|
@ -153,7 +153,8 @@ func (o *casaService) AsyncGetServerList() (collection model.ServerAppListCollec
|
||||||
collection.List = listModel
|
collection.List = listModel
|
||||||
collection.Recommend = recommendModel
|
collection.Recommend = recommendModel
|
||||||
collection.Version = o.GetCasaosVersion().Version
|
collection.Version = o.GetCasaosVersion().Version
|
||||||
by, err := json.Marshal(collection)
|
var by []byte
|
||||||
|
by, err = json.Marshal(collection)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
loger.Error("marshal error", zap.Any("err", err))
|
loger.Error("marshal error", zap.Any("err", err))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue