Commit 192a2bef69ea05d6877b91c777dfce7867960af9
1 parent
26577980
no message
Showing
1 changed file
with
6 additions
and
5 deletions
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
| @@ -255,13 +255,14 @@ | @@ -255,13 +255,14 @@ | ||
| 255 | [self setUpUIWithTag:webView.tag Height:0]; | 255 | [self setUpUIWithTag:webView.tag Height:0]; |
| 256 | return; | 256 | return; |
| 257 | } | 257 | } |
| 258 | - AFHTTPSessionManager *manager =[AFHTTPSessionManager manager]; | 258 | + |
| 259 | + AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; | ||
| 259 | manager.responseSerializer = [AFHTTPResponseSerializer serializer]; | 260 | manager.responseSerializer = [AFHTTPResponseSerializer serializer]; |
| 260 | [manager POST:@"http://s.scio.gov.cn/ocms/.content/function_provider/arswitch.json" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { | 261 | [manager POST:@"http://s.scio.gov.cn/ocms/.content/function_provider/arswitch.json" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { |
| 261 | - NSString *result = [[NSString alloc]initWithData:responseObject encoding:NSUTF8StringEncoding]; | ||
| 262 | - NSLog(@"%@",result); | ||
| 263 | - [self setUpUIWithTag:webView.tag Height:[result isEqualToString:@"\n\n 0"]?40.0:0.0]; | ||
| 264 | - | 262 | + NSLog(@"%@",responseObject); |
| 263 | + NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil]; | ||
| 264 | + NSString *errorCode = dic[@"errorCode"]; | ||
| 265 | + [self setUpUIWithTag:webView.tag Height:[errorCode isEqualToString:@"1"]?40.0:0.0]; | ||
| 265 | 266 | ||
| 266 | } failure:^(NSURLSessionDataTask *task, NSError *error) { | 267 | } failure:^(NSURLSessionDataTask *task, NSError *error) { |
| 267 | NSLog(@"%@",error); | 268 | NSLog(@"%@",error); |