//
//  JsonUtils.m
//  Open
//
//  Created by weface on 2023/6/6.
//  Copyright © 2023 QXY. All rights reserved.
//

#import "JsonUtils.h"

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