修复优化bug
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// YinCustomAttachmentCoding.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MJExtension
|
||||
|
||||
class YinCustomAttachmentCoding: NSObject,NIMCustomAttachmentCoding {
|
||||
func decodeAttachment(_ content: String?) -> NIMCustomAttachment? {
|
||||
|
||||
if let text = content as? NSString{
|
||||
if var data = text.mj_JSONObject() as? [String : Any],let first = data["first"] as? Int,let second = data["second"] as? Int,let dic = data["data"]{
|
||||
|
||||
if let _dic = dic as? [String : Any]{
|
||||
let model = ChatCustomMsgModel()
|
||||
model.first = first
|
||||
model.second = second
|
||||
model.data = _dic
|
||||
return model
|
||||
|
||||
}
|
||||
if let _dic = dic as? NSString,let getDic = _dic.mj_JSONObject(),let getData = getDic as? [String:Any]{
|
||||
let model = ChatCustomMsgModel()
|
||||
model.first = first
|
||||
model.second = second
|
||||
model.data = getData
|
||||
return model
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user