Commit a517a653 authored by 翟国钧's avatar 翟国钧

上传图片增加error==0时成功的判断

parent 0f9d1145
...@@ -66,11 +66,16 @@ ...@@ -66,11 +66,16 @@
__weak __typeof(self)weakSelf = self; __weak __typeof(self)weakSelf = self;
[[WMNetService sharedInstance] sendUploadTaskRequestWithData:imageData fileName:@"file" name:@"file" url:_url mineType:@"image/jpeg" parameters:_params success:^(NSDictionary* jsonData) { [[WMNetService sharedInstance] sendUploadTaskRequestWithData:imageData fileName:@"file" name:@"file" url:_url mineType:@"image/jpeg" parameters:_params success:^(NSDictionary* jsonData) {
NSInteger error = [jsonData[@"error"] integerValue];
if (self.imageUploadFinishBlock) { if (error == 0) {
weakSelf.imageUploadFinishBlock(jsonData); if (self.imageUploadFinishBlock) {
weakSelf.imageUploadFinishBlock(jsonData);
}
} else {
if (self.imageUploadFinishBlock) {
weakSelf.imageUploadFinishBlock(nil);
}
} }
} failed:^(NSString *errorMsg) { } failed:^(NSString *errorMsg) {
if (self.imageUploadFinishBlock) { if (self.imageUploadFinishBlock) {
weakSelf.imageUploadFinishBlock(nil); weakSelf.imageUploadFinishBlock(nil);
......
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