- (void)acquireDataWithHandler:(nonnull void (^)(NSDictionary * _Nullable, SWKError * _Nullable))handler {
// 进行数据请求
[ZZZAPIAccessManager requestData:@"getsku" params:[self getAPIParams] handler:^(NSDictionary *info, SWKError *error) {
if (error) {
handler(info, error);
return;
}
///得到的结果有null的就删除
NSMutableDictionary *nonNullDictionary = info.mutableCopy;
[info enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
if ([obj isKindOfClass:[NSNull class]]) {
[nonNullDictionary removeObjectForKey:key];
}
}];
handler(nonNullDictionary, error);
}];
}