//上传头像
+(void)uploadImage:(UIImage *)image getImage:(getHeadBlock)getImage{
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
NSString *imageURl = UpLoadHeadImage;
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithArray:@[@"text/html",@"multipart/form-data",@"application/json"]];
[manager POST:imageURl parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
NSData *data = UIImagePNGRepresentation(image);
[formData appendPartWithFileData:data name:@"file" fileName:@"user.png" mimeType:@"image/png"];
} progress:^(NSProgress * _Nonnull uploadProgress) {
NSLog(@"%@",uploadProgress);
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
getImage(json[@"info"][@"imgurl"]);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"%@",error);
}];
}