Ver código fonte

【分包下载】初始版本下载配置调整

lizhe 1 ano atrás
pai
commit
52ac69d047

+ 6 - 1
PDF Office/PDF Master/Class/KMResourceDownload/KMResourceDownloadManager.swift

@@ -83,6 +83,11 @@ class KMResourceDownloadManager: NSObject {
             if urlString.count != 0 {
                 let filePath: String = kResourcePath! + "/DocumentAI.bundle"
                 try?FileManager.default.removeItem(atPath: filePath)
+                
+                let fileManager = FileManager.default
+                let folderURL = fileManager.temporaryDirectory.appendingPathComponent("XMLResources")
+                let xmlURL = folderURL.appendingPathComponent("DocumentAI.xml")
+                try?FileManager.default.removeItem(at: xmlURL)
             }
         }
     }
@@ -140,7 +145,7 @@ extension KMResourceDownloadManager: XMLParserDelegate {
 
         // 4. 解析 XML 并比较版本号
         // 创建 XMLParser 实例
-        var downloadedVersion = "1.0"
+        var downloadedVersion = "0.0"
         if let xmlData = try? Data(contentsOf: self.fetchXMLURL()) {
             let xmlParser = XMLParser(data: xmlData)
             let xmlDelegate = XMLDelegate()