Pārlūkot izejas kodu

Merge branch 'release/1.0.0'

南鑫林 5 gadi atpakaļ
vecāks
revīzija
cda0d8bbd6

+ 5 - 0
RainbowPlanet/RainbowPlanet/Manager/AliyunVodManager/AliyunVodUpToyoPublishManager/AliyunVodupToyoPublishManager.swift

@@ -140,6 +140,8 @@ extension AliyunVodUpToyoPublishManager {
                 self?.progressView?.attachedView?.isHidden = true
                 self?.destroy()
                 NotificationCenter.default.post(name: NSNotification.Name("PublishPostSuccess"), object: nil)
+                }, fail: {
+                    
             })
 
         }) { [weak self] _ in
@@ -222,6 +224,9 @@ extension AliyunVodUpToyoPublishManager {
                 self?.progressView?.attachedView?.isHidden = true
                 self?.destroy()
                 NotificationCenter.default.post(name: NSNotification.Name("PublishPostSuccess"), object: nil)
+                }, fail: { [weak self] in
+                    self?.progressView?.attachedView?.isHidden = true
+                    self?.destroy()
             })
 
         }) { [weak self] _ in

+ 12 - 16
RainbowPlanet/RainbowPlanet/Manager/MapManager/BaiduMapManager/BaiduMapManager.swift

@@ -30,6 +30,8 @@ public class BaiduMapManager: NSObject {
     typealias LocationFalseBlock = () -> Void
 
     var  locationFalseBlock : LocationFalseBlock?
+    
+    var isLocation : Bool = false
 
     
     /// 初始化百度
@@ -81,6 +83,7 @@ public class BaiduMapManager: NSObject {
         
         locationManager.requestLocation(withReGeocode: true, withNetworkState: true) { [weak self] location, state, error in
             if (error != nil) {
+                 self?.isLocation = false
                 locationFalseBlock()
                 return
             } else {
@@ -110,6 +113,7 @@ public class BaiduMapManager: NSObject {
                     }
                     
                     LocationModel.shared().saveObject(locationModel: self?.locationModel ?? LocationModel())
+                    self?.isLocation = true
                     NXLLog(LocationModel.shared().object())
                     locationSuccessBlock()
                 }
@@ -120,28 +124,15 @@ public class BaiduMapManager: NSObject {
     
     /// 定位设置弹框
     func loacationAlertView() {
-        AlertSheetView.alert(title: "定位服务未开启", detailTitle: "请进入系统设置「设置」「隐私」「定位服务」中打开开关,并允许彩虹星球使用定位服务", cancelTitle: "取消", sureTitle: "立即开启", cancelBlock: { (popupView, Int, string) in
-            if let locationFalseBlock = self.locationFalseBlock {
-                locationFalseBlock()
-            }
-        }, confirmBlock: { (popupView, Int, string) in
+        AlertSheetView.alert(title: "定位服务未开启", detailTitle: "请进入系统设置「设置」「隐私」「定位服务」中打开开关,并允许由你使用定位服务", cancelTitle: "取消", sureTitle: "立即开启", cancelBlock: { (popupView, Int, string) in
 
+        }, confirmBlock: { (popupView, Int, string) in
             if #available(iOS 10.0, *) {
 
                 let url = URL(string: UIApplication.openSettingsURLString)
                 if let url = url {
                     if UIApplication.shared.canOpenURL(url) {
-                        UIApplication.shared.open(url, options: [:], completionHandler: { [weak self] success in
-                            self?.initLocation(locationSuccessBlock: {
-                                if let locationSuccessBlock = self?.locationSuccessBlock {
-                                    locationSuccessBlock()
-                                }
-                            }, locationFalseBlock: { [weak self] in
-                                if let locationFalseBlock = self?.locationFalseBlock {
-                                    locationFalseBlock()
-                                }
-                            })
-                        })
+                        UIApplication.shared.open(url, options: [:], completionHandler: { success in })
                     }
                 }
             } else {
@@ -152,7 +143,10 @@ public class BaiduMapManager: NSObject {
                     }
                 }
             }
+            popupView.hide()
+
         })
+        
     }
     
     
@@ -240,11 +234,13 @@ extension BaiduMapManager:BMKLocationManagerDelegate {
             //该值应用于iOS、tvos和watchos。它在上有售
             //macos,但kclauthorizationstatusauthorized是同义词且首选。
             startLocation()
+            self.isLocation = true
         }else if status == .authorizedWhenInUse {
             //只有在应用程序
             //对它们可见(如果继续在后台接收位置更新)。授权使用
             //尚未授予启动API。此值在MacOS上不可用。它应该在iOS、tvos和沃特克斯。
             startLocation()
+             self.isLocation = true
         }
         
     }

+ 9 - 11
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift

@@ -23,9 +23,7 @@ class CommunityFollowViewController: BaseViewController {
         }
     }
     weak var observe : NSObjectProtocol?
-    
-    var lastContentOffset : CGFloat = 0
-    
+        
     var navigationBarIsHidden: Bool = false
     
     var communityFollowDataModels : Array<CommunityFollowDataModel>?
@@ -298,7 +296,10 @@ extension CommunityFollowViewController {
     /// 删除帖子
     func communityDeleteApi(postId:Int,section:Int) {
         SwiftMoyaNetWorkServiceCommunity.shared().communityDeleteApi(postId: postId) { [weak self] (data) -> (Void) in
-            self?.communityFollowDataModels?.remove(at: section)
+            if !(self?.communityFollowDataModels?.isEmpty ?? true) {
+                self?.communityFollowDataModels?.remove(at: section)
+            }
+            
             self?.tableView.reloadData()
         }
     }
@@ -727,14 +728,11 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
 }
 
 extension CommunityFollowViewController {
-    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
-        //全局变量记录滑动前的contentOffset
-        lastContentOffset = scrollView.contentOffset.y;//判断上下滑动时
-    }
     
     func scrollViewDidScroll(_ scrollView: UIScrollView) {
+        let point = scrollView.panGestureRecognizer.translation(in: self.view)
         
-        if scrollView.contentOffset.y > lastContentOffset {
+        if point.y < 0  {
             //向上
             if communityNavigationBarIsHidden == false && communityIndex != 2 {
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityViewControllerScrollView"), object: true)
@@ -745,10 +743,10 @@ extension CommunityFollowViewController {
                 self.view.layoutIfNeeded()
                 self.navigationBarIsHidden = true
             }
-        } else if scrollView.contentOffset.y < lastContentOffset && communityIndex != 2 {
+        } else  {
             //向下
             
-            if communityNavigationBarIsHidden {
+            if communityNavigationBarIsHidden && communityIndex != 2 {
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityViewControllerScrollView"), object: false)
                 tableView.snp.updateConstraints { (make) in
                     make.height.equalTo(kScreenHeight-48-kNavBarTotalHeight-kTabBarTotalHeight)

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift

@@ -227,10 +227,11 @@ class CommunityViewController: BaseViewController {
                 }
             }
             communityNavigationBarIsHidden = navigationBarIsHidden!
-            UIView.animate(withDuration: 0.5, animations: { [weak self] in
+            UIView.animate(withDuration: 0.15, animations: { [weak self] in
                 self?.view.layoutIfNeeded()
                 self?.listContainerView.layoutSubviews()
             }) { (complete) in}
+
         }
         
     }
@@ -414,7 +415,7 @@ extension CommunityViewController : JXSegmentedViewDelegate {
                      make.top.equalTo(kNavBarTotalHeight)
                 }
                 communityNavigationBarIsHidden = false
-                UIView.animate(withDuration: 0.5, animations: { [weak self] in
+                UIView.animate(withDuration: 0.15, animations: { [weak self] in
                     self?.view.layoutIfNeeded()
                     self?.listContainerView.layoutSubviews()
                 }) { (complete) in}

+ 12 - 13
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift

@@ -24,8 +24,6 @@ class CommunityRecommnendViewController: UIViewController {
     /// 评论需要的模型
     var communityRecommendDataModel : CommunityRecommendDataModel?
     
-    var lastContentOffset : CGFloat = 0
-    
     var navigationBarIsHidden: Bool = false
     
     override func viewDidLoad() {
@@ -234,7 +232,9 @@ extension CommunityRecommnendViewController {
     /// 删除帖子
     func communityDeleteApi(postId:Int,section:Int) {
         SwiftMoyaNetWorkServiceCommunity.shared().communityDeleteApi(postId: postId) { [weak self] (data) -> (Void) in
-            self?.communityRecommendDataModels.remove(at: section)
+            if !(self?.communityRecommendDataModels.isEmpty ?? true) {
+                self?.communityRecommendDataModels.remove(at: section)
+            }
             self?.tableView.reloadData()
         }
     }
@@ -635,35 +635,34 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
 }
 
 extension CommunityRecommnendViewController {
-    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
-        //全局变量记录滑动前的contentOffset
-        lastContentOffset = scrollView.contentOffset.y;//判断上下滑动时
-    }
     
     func scrollViewDidScroll(_ scrollView: UIScrollView) {
-        if scrollView.contentOffset.y > lastContentOffset && communityIndex != 2 {
+        
+        let point = scrollView.panGestureRecognizer.translation(in: self.view)
+        
+        if point.y < 0  {
             //向上
-            if communityNavigationBarIsHidden == false {
+            if communityNavigationBarIsHidden == false && communityIndex != 2 {
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityViewControllerScrollView"), object: true)
                 tableView.snp.updateConstraints { (make) in
                     make.height.equalTo(kScreenHeight-48-kSafeStatusBarHeight-kTabBarTotalHeight)
                 }
-//                self.view.layoutIfNeeded()
                 communityNavigationBarIsHidden = true
 
             }
-        } else if scrollView.contentOffset.y < lastContentOffset && communityIndex != 2 {
+        } else  {
             //向下
             
-            if communityNavigationBarIsHidden {
+            if communityNavigationBarIsHidden && communityIndex != 2 {
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityViewControllerScrollView"), object: false)
                 tableView.snp.updateConstraints { (make) in
                     make.height.equalTo(kScreenHeight-48-kNavBarTotalHeight-kTabBarTotalHeight)
                 }
-//                self.view.layoutIfNeeded()
                 communityNavigationBarIsHidden = false
             }
         }
+        self.view.layoutIfNeeded()
+
     }
 }
 

+ 17 - 13
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/View/PublishAddressPOIView.swift

@@ -183,20 +183,24 @@ extension PublishAddressPOIView:UITableViewDataSource,UITableViewDelegate {
             case 0:
                 break
             default:
-                if self.suggestionList != nil {
-                    let locationModel = LocationModel.shared().object()
-                    let suggestionList = self.suggestionList?[indexPath.row]
-                    let city = suggestionList?.city ?? ""
-                    let district = suggestionList?.district ?? ""
-                    let key = suggestionList?.key ?? ""
-                    let latitude = "\(suggestionList?.location.latitude ?? 0)"
-                    let longitude = "\(suggestionList?.location.longitude ?? 0)"
-                    let toString = locationModel!.province  + city + district  + key
-                    didSelectBlock(latitude,longitude,toString)
+                if BaiduMapManager.shared.isLocation {
+                    if self.suggestionList != nil {
+                        let locationModel = LocationModel.shared().object()
+                        let suggestionList = self.suggestionList?[indexPath.row]
+                        let city = suggestionList?.city ?? ""
+                        let district = suggestionList?.district ?? ""
+                        let key = suggestionList?.key ?? ""
+                        let latitude = "\(suggestionList?.location.latitude ?? 0)"
+                        let longitude = "\(suggestionList?.location.longitude ?? 0)"
+                        let toString = (locationModel?.province ?? "")  + city + district  + key
+                        didSelectBlock(latitude,longitude,toString)
+                    }else {
+                        let selPoiName = self.poiList?[indexPath.row].name
+                        let locationModel = LocationModel.shared().object()
+                        didSelectBlock(locationModel!.latitude, locationModel!.longitude, selPoiName ?? "")
+                    }
                 }else {
-                    let selPoiName = self.poiList?[indexPath.row].name
-                    let locationModel = LocationModel.shared().object()
-                    didSelectBlock(locationModel!.latitude, locationModel!.longitude, selPoiName ?? "")
+                    BaiduMapManager.shared.loacationAlertView()
                 }
                 break
             }

+ 9 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/ViewController/PublishAddAddressController.swift

@@ -8,6 +8,9 @@
 
 import UIKit
 
+
+
+
 class PublishAddAddressController: BaseViewController {
     
     override func didReceiveMemoryWarning() {
@@ -18,8 +21,10 @@ class PublishAddAddressController: BaseViewController {
         NXLLog("deinit")
     }
     
+    
     typealias SelectLocationClosure = (_ address:String) -> Void
     var selectLocationClosure : SelectLocationClosure?
+   
     
     var locationAddress: String?
     /// 纬度
@@ -33,15 +38,16 @@ class PublishAddAddressController: BaseViewController {
         super.viewDidLoad()
         setupViews()
         setupLayouts()
-        
-        BaiduMapManager.shared.startLocation()
         BaiduMapManager.shared.locationSuccessBlock =  {
             [weak self] in
             self?.poiList = LocationModel.shared().object()?.poiList ?? []
             self?.addressPOIView.poiList = self?.poiList
         }
-        BaiduMapManager.shared.locationFalseBlock =  {            SwiftProgressHUD.shared().showText("定位失败")
+        BaiduMapManager.shared.locationFalseBlock =  {
+            BaiduMapManager.shared.loacationAlertView()
         }
+        BaiduMapManager.shared.startLocation()
+
     }
     
     override func viewWillAppear(_ animated: Bool) {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicVolumnView.swift

@@ -241,8 +241,8 @@ class PublishMusicVolumnView: FWPopupView {
         
         view.applyButton.rx.tap.subscribe(onNext: {[weak view] (data) in
             var paraDic = Dictionary<String, Any>()
-            paraDic.updateValue(view?.originVolumn!, forKey: "origin")
-            paraDic.updateValue(view?.backVolumn!, forKey: "back")
+            paraDic.updateValue(view?.originVolumn! as Any, forKey: "origin")
+            paraDic.updateValue(view?.backVolumn! as Any, forKey: "back")
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ChangeAudioVolumnNoti"), object: paraDic)
             
             view?.hide()

+ 2 - 1
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceVirus/SwiftMoyaNetWorkServiceVirus.swift

@@ -26,7 +26,7 @@ class SwiftMoyaNetWorkServiceVirus: NSObject {
     /// - Parameters:
     ///   - virueRecordAddParameterModel: 生成账本摩西
     ///   - completion: completion description
-    func virueRecordAddApi(virueRecordAddParameterModel:VirueRecordAddParameterModel,completion: @escaping successCallBack) {
+    func virueRecordAddApi(virueRecordAddParameterModel:VirueRecordAddParameterModel,completion: @escaping successCallBack,fail:@escaping failCallback) {
         
         if !UserModel.isTokenNil() {
             var parameters = Dictionary<String,Any>()
@@ -35,6 +35,7 @@ class SwiftMoyaNetWorkServiceVirus: NSObject {
                 completion("")
             }) {
                 (loadingStatus) in
+                fail(loadingStatus)
             }
         }
         

+ 26 - 24
RainbowPlanet/RainbowPlanet/ViewModel/Virus/VirusViewModel.swift

@@ -46,7 +46,7 @@ extension VirusViewModel {
                 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "unlikeApi"), object: followStatusModel)
                 completion(1)
             }
-        })
+        }, fail: {_ in})
     }
     
     /// 喜欢/不喜欢
@@ -111,7 +111,7 @@ extension VirusViewModel {
             }
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isLikeApi"), object: followStatusModel)
 
-        })
+        }, fail: {_ in})
     }
     
     /// 点赞
@@ -175,7 +175,7 @@ extension VirusViewModel {
                 completion(0)
             }
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isCollectApi"), object: followStatusModel)
-        })
+        }, fail: {_ in})
     }
     
     /// 收藏
@@ -228,7 +228,7 @@ extension VirusViewModel {
                 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "unlikeApi"), object: followStatusModel)
                 completion(1)
             }
-        })
+        }, fail: {_ in})
     }
     
     /// 喜欢/不喜欢
@@ -296,7 +296,7 @@ extension VirusViewModel {
             }
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isLikeApi"), object: followStatusModel)
 
-        })
+        }, fail: {_ in})
     }
     
     /// 点赞
@@ -359,7 +359,7 @@ extension VirusViewModel {
                 completion(0)
             }
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isCollectApi"), object: followStatusModel)
-        })
+        }, fail: {_ in})
     }
     
     /// 收藏
@@ -421,7 +421,7 @@ extension VirusViewModel {
                 completion(0)
             }
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isLikeApi"), object: followStatusModel)
-        })
+        }, fail: {_ in})
     }
     
     /// 点赞
@@ -486,7 +486,7 @@ extension VirusViewModel {
             }
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isCollectApi"), object: followStatusModel)
 
-        })
+        }, fail: {_ in})
     }
     
     /// 收藏
@@ -526,7 +526,7 @@ extension VirusViewModel {
         virueRecordAddParameterModel.commentId = id
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
     func comment(communityFollowDataModel:CommunityFollowDataModel? = nil,id:Int,content:String) {
@@ -553,7 +553,7 @@ extension VirusViewModel {
         
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
     
@@ -579,7 +579,7 @@ extension VirusViewModel {
         
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
     func commentReply(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil) {
@@ -608,7 +608,7 @@ extension VirusViewModel {
         virueRecordAddParameterModel.commentId = id
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
     func commentReplyAIT(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
@@ -642,7 +642,7 @@ extension VirusViewModel {
         
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
     func commentVideo(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String) {
@@ -667,7 +667,7 @@ extension VirusViewModel {
         virueRecordAddParameterModel.commentId = id
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
     func commentVideoReply(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil) {
@@ -697,7 +697,7 @@ extension VirusViewModel {
         virueRecordAddParameterModel.commentId = id
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
     func commentVideoReplyAIT(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
@@ -730,7 +730,7 @@ extension VirusViewModel {
         virueRecordAddParameterModel.commentId = id
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
     
 }
@@ -783,7 +783,7 @@ extension VirusViewModel {
             commentView?.communityPostDetailModel = communityPostDetailModel
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isLikeApi"), object: followStatusModel)
 
-        })
+        }, fail: {_ in})
     }
     
     
@@ -836,7 +836,7 @@ extension VirusViewModel {
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isCollectApi"), object: followStatusModel)
 
 
-        })
+        }, fail: {_ in})
     }
 }
 
@@ -894,7 +894,7 @@ extension VirusViewModel {
             cell?.likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isLikeApi"), object: followStatusModel)
 
-        })
+        }, fail: {_ in})
     }
 }
 
@@ -920,7 +920,7 @@ extension VirusViewModel {
             virueRecordAddParameterModel.postType = postType
             virueRecordAddParameterModel.postCover = postCover
             SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-            })
+            }, fail: {_ in})
     }
 }
 
@@ -945,13 +945,13 @@ extension VirusViewModel {
         virueRecordAddParameterModel.postCover = postCover
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
+        }, fail: {_ in})
     }
 }
 
 // MARK: - 发布
 extension VirusViewModel {
-    func publishVirueRecordAddApi(postId:Int?,postType:String?,title:String?,content:String?,postCover:String?,completion:@escaping ()->Void) {
+    func publishVirueRecordAddApi(postId:Int?,postType:String?,title:String?,content:String?,postCover:String?,completion:@escaping ()->Void,fail:@escaping ()->Void) {
         
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
         virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.publish ?? "")
@@ -971,7 +971,9 @@ extension VirusViewModel {
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
             completion()
-        })
+        }){ _ in
+            fail()
+        }
     }
 }
 
@@ -987,7 +989,7 @@ extension VirusViewModel {
             virueRecordAddParameterModel.actionId = BehaviorFlagType.register.rawValue
             SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
                 completion()
-            })
+            }, fail: {_ in})
         }
     }
 }