Commit a9d5a4ec authored by Steven杜宇's avatar Steven杜宇

// 优化上传大文件 UI显示异常问题

parent b32c8ff5
......@@ -538,15 +538,16 @@ extension YHCertificateUploadSheetView: UIDocumentPickerDelegate {
fileCoordinator.coordinate(readingItemAt: url, options:[.forUploading], error: &error) {
fileUrl in
uploadFilesBlock?(fileUrl)
dismiss()
uploadFilesBlock?(fileUrl)
}
url.stopAccessingSecurityScopedResource()
if let error = error {
printLog("\(error.localizedDescription)")
}
} else {
print("授权失败")
YHHUD.flash(message: "文件授权失败")
dismiss()
}
}
......
......@@ -111,6 +111,8 @@ class YHOSSManager: NSObject, URLSessionDelegate {
callBackBlock(nil, YHErrorModel())
return
}
DispatchQueue.global().async {
let fileExtension = URL(fileURLWithPath: file).pathExtension.lowercased()
request.uploadingData = fileData
request.bucketName = self.model.bucket
......@@ -145,6 +147,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
return
}).waitUntilFinished()
}
}
func getPublic(url: String, callBackBlock:@escaping (_ success: String?, _ error:YHErrorModel?)->()) {
let bucketName = self.getBucket(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment