Browse Source

1.修复存储设备信息闪退问题

huangxiaodong 9 months ago
parent
commit
1b747b9f26
1 changed files with 21 additions and 1 deletions
  1. 21 1
      创维盒子/code/AppDelegate/SceneDelegate.m

+ 21 - 1
创维盒子/code/AppDelegate/SceneDelegate.m

@@ -299,7 +299,27 @@
                 ksharedAppDelegate.DeviceThirdIdMod = model;
                 
                 NSMutableDictionary *IdDataDict = [[NSMutableDictionary alloc] initWithDictionary:responseObject];
-                [IdDataDict removeObjectForKey:@"retCode"];
+                
+                for (NSString *key in responseObject) {
+                    id object = IdDataDict[key];
+                    if(!object || [object isKindOfClass:[NSNull class]]){
+                        [IdDataDict removeObjectForKey:key];
+                    }
+                }
+                
+                if([[IdDataDict allKeys] containsObject:@"data"]){
+                    NSMutableDictionary *DataDict = [[NSMutableDictionary alloc] initWithDictionary:responseObject[@"data"]];
+                    
+                    for (NSString *key in responseObject[@"data"]) {
+                        id object = DataDict[key];
+                        if(!object || [object isKindOfClass:[NSNull class]]){
+                            [DataDict removeObjectForKey:key];
+                        }
+                    }
+                    
+                    IdDataDict[@"data"] = DataDict;
+                }
+                
                 
                 //数据缓存
                 NSString *key = stringKeyAddSn(@"ThirdIdBySn");