使用场景: 批量删除
let dic1: Dictionary<String,Int> = ["user_id":5, "org_id":12,"class_id": 1]
let dic2:Dictionary<String,Int>=["user_id":5, "org_id":12,"class_id": 1]
let dic3:Dictionary<String,Int>=["user_id":5, "org_id":12,"class_id": 1]
let arr = [dic1,dic2,dic3]
let dic4:Dictionary<String,[Dictionary<String, Int>]>=["lists":arr]
let data = try? JSONSerialization.data(withJSONObject: dic4, options: JSONSerialization.WritingOptions.prettyPrinted)
let strJson = NSString(data: data!, encoding: String.Encoding.utf8.rawValue)
print("strJson===\(String(describing: strJson))")
然后 当参数传给后台