1.项目涉及加密和解密,对传参数二次处理,必须将字典无序改为有序处理,然后传json
NSDictionary*dictionary =@{
@"kpackage_name": @"comes",
@"ktimestamp": currentStamp,
@"kuser_id": userID,
@"kprivate": private,
@"kplatform": @"ios"
};
NSArray *orderedKeys = @[@"kpackage_name", @"ktimestamp", @"kuser_id",@"kprivate",@"kplatform"];
NSMutableArray *jsonComponents = [NSMutableArray array];
for(NSString*keyinorderedKeys) {
idvalue = dictionary[key];
[jsonComponentsaddObject:[NSString stringWithFormat:@"\"%@\":\"%@\"", key, value]];
}
NSString *gameJson = [NSString stringWithFormat:@"{%@}", [jsonComponents componentsJoinedByString:@","]];