Browse Source

修改缓存加载逻辑

jsonwang 3 years ago
parent
commit
331f275d15

+ 8 - 8
MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -234,15 +234,15 @@ class MVHomeController: MVBaseController {
             } else {
             } else {
                 if(MVHotVideoModel.getCacheData().count == 0){
                 if(MVHotVideoModel.getCacheData().count == 0){
                     self?.showNetworkError(isHidden: false)
                     self?.showNetworkError(isHidden: false)
+                }else{
+                    //没有网时查看有无缓存
+                    let cacheData = MVHotVideoModel.getCacheData()
+                    if(cacheData.count > 0){
+                        BFLog(message: "有缓存数据 ")
+                        self?.refreshData(hotVideos: cacheData)
+                    }
                 }
                 }
-                
-                //没有网时查看有无缓存
-                let cacheData = MVHotVideoModel.getCacheData()
-                if(cacheData.count > 0){
-                    BFLog(message: "有缓存数据 ")
-                    self?.refreshData(hotVideos: cacheData)
-                }
-               
+      
             }
             }
         }
         }