Ver Fonte

【会员系统】AI接口兼容,权益判断调整

niehaoyu há 6 dias atrás
pai
commit
4c806bb159

+ 2 - 2
PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift

@@ -320,7 +320,7 @@ class ResultWrapper: NSObject {
                     let code: String = data["code"] as? String ?? "06005"
                     if Int(code)! == 200, let dataDic = data["data"] {
                         let wrapper = ResultWrapper(success: true, resultData: dataDic as! NSDictionary)
-                        if let value = data["fileKey"] {
+                        if let value = (dataDic as! NSDictionary)["fileKey"] {
                             wrapper.content = value as! String
                         }
                         complete(wrapper)
@@ -889,7 +889,7 @@ class KMAIRequestServer {
                 var message: String = ""
                 if let string = jsonObject!["data"] {
                     let dataDic = jsonObject!["data"] as? NSDictionary ?? [:]
-                    if let dataStr = dataDic["dst"] {
+                    if let dataStr = dataDic["content"] {
                         message = dataStr as! String
                         result_bool = true
                     }

+ 5 - 1
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -832,10 +832,14 @@ import Cocoa
                 return true
             }
             if AIInfoManager.default().aiInfo.totalToken - AIInfoManager.default().aiInfo.usedTimes > 0 {
-                return false
+                return true
             } else {
                 return false
             }
+        } else {
+            if AIInfoManager.default().aiInfo.totalToken - AIInfoManager.default().aiInfo.usedTimes > 0 {
+                return true
+            }
         }
         return false
 #endif