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

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

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