Commit e741a4ec authored by 朱璇's avatar 朱璇

修改请求方式

parent 58c8b280
......@@ -123,17 +123,12 @@
NSURLSession *session = [NSURLSession sharedSession];
__block NSString *result = @"";
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if (!error) {
//没有错误,返回正确;
result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"返回正确:%@",result);
}else{
//出现错误;
NSLog(@"错误信息:%@",error);
if (success) {
success(code);
}
}
}];
......
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