Commit e741a4ec authored by 朱璇's avatar 朱璇

修改请求方式

parent 58c8b280
...@@ -123,17 +123,12 @@ ...@@ -123,17 +123,12 @@
NSURLSession *session = [NSURLSession sharedSession]; NSURLSession *session = [NSURLSession sharedSession];
__block NSString *result = @""; __block NSString *result = @"";
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if (!error) { if (!error) {
//没有错误,返回正确; //没有错误,返回正确;
result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; if (success) {
NSLog(@"返回正确:%@",result); success(code);
}
}else{
//出现错误;
NSLog(@"错误信息:%@",error);
} }
}]; }];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment