//
//  NSDictionary+JsonStr.m
//  EESBCardSDKTest
//
//  Created by 雷俊博 on 2019/5/20.
//  Copyright © 2019 雷俊博. All rights reserved.
//

#import "NSDictionary+JsonStr.h"

@implementation NSDictionary (JsonStr)

+ (NSDictionary *)dictionaryWithJsonStr:(NSString *)jsonString {
    if (jsonString == nil) {
        return nil;
    }
    
    NSData* data = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
    NSError* error;
    NSDictionary* dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
    if (error) {
        NSLog(@"json解析失败:%@",error);
        return nil;
    }
    return dic;
}
@end
