|
@@ -158,8 +158,8 @@ public func commonParams() -> [String: Any] {
|
|
|
"versionCode": versionCode,
|
|
|
"system": systemName + " " + systemVersion,
|
|
|
"systemVersion": systemName + " " + systemVersion,
|
|
|
- "appType": "15",
|
|
|
- "appId": "1570572849",
|
|
|
+ "appType": PQBFConfig.shared.appType,
|
|
|
+ "appId": PQBFConfig.shared.appId,
|
|
|
"machineCode": getMachineCode(),
|
|
|
"networkType": networkStatus(),
|
|
|
"ipAddress": ipAddress(),
|
|
@@ -720,45 +720,7 @@ public func contentMD5(path: String? = nil, data _: Data? = nil) -> String? {
|
|
|
let hash: String = OSSUtil.base64Md5(forFilePath: path)
|
|
|
BFLog(message: "生成内容md5值:contentMD5 = \(hash)")
|
|
|
return hash
|
|
|
-
|
|
|
- // let ctxLen = MemoryLayout<CC_MD5_CTX>.size
|
|
|
- // let ctx = UnsafeMutablePointer<CC_MD5_CTX>.allocate(capacity: ctxLen)
|
|
|
- // CC_MD5_Init(ctx)
|
|
|
- // if path != nil {
|
|
|
- // let handle = FileHandle(forReadingAtPath: path!)
|
|
|
- // if handle == nil {
|
|
|
- // return nil
|
|
|
- // }
|
|
|
- // var done = false
|
|
|
- // while !done {
|
|
|
- // let fileData = handle?.readData(ofLength: 256)
|
|
|
- // fileData?.withUnsafeBytes { (bytes: UnsafePointer<CChar>) -> Void in
|
|
|
- // CC_MD5_Update(ctx, bytes, CC_LONG(fileData!.count))
|
|
|
- // }
|
|
|
- //
|
|
|
- // if fileData?.count == 0 {
|
|
|
- // done = true
|
|
|
- // }
|
|
|
- // }
|
|
|
- // } else if path == nil && data != nil {
|
|
|
- // let fileData = data
|
|
|
- // fileData?.withUnsafeBytes { (bytes: UnsafePointer<CChar>) -> Void in
|
|
|
- // CC_MD5_Update(ctx, bytes, CC_LONG(fileData!.count))
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // return nil
|
|
|
- // }
|
|
|
- // // unsigned char digest[CC_MD5_DIGEST_LENGTH];
|
|
|
- // let digestLen = Int(CC_MD5_DIGEST_LENGTH)
|
|
|
- // let digest = UnsafeMutablePointer<CUnsignedChar>.allocate(capacity: digestLen)
|
|
|
- // CC_MD5_Final(digest, ctx)
|
|
|
- //
|
|
|
- // var hash = ""
|
|
|
- // for i in 0 ..< digestLen {
|
|
|
- // hash += String(format: "%02x", (digest[i]))
|
|
|
- // }
|
|
|
- // digest.deinitialize(count: digestLen)
|
|
|
- // ctx.deinitialize(count: ctxLen)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -792,26 +754,26 @@ public func isValidURL(url: String?) -> Bool {
|
|
|
}
|
|
|
|
|
|
/// 相册数据按创建时间排序
|
|
|
-var creaFetchOptions: PHFetchOptions = {
|
|
|
+public var creaFetchOptions: PHFetchOptions = {
|
|
|
let fetchOptions = PHFetchOptions()
|
|
|
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
|
|
|
return fetchOptions
|
|
|
}()
|
|
|
|
|
|
/// 相册数据按修改时间排序
|
|
|
-var modiFetchOptions: PHFetchOptions = {
|
|
|
+public var modiFetchOptions: PHFetchOptions = {
|
|
|
let fetchOptions = PHFetchOptions()
|
|
|
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "modificationDate", ascending: false)]
|
|
|
return fetchOptions
|
|
|
}()
|
|
|
|
|
|
/// 获取本地素材
|
|
|
-var avAssertOptions: [String: Any]? = {
|
|
|
+public var avAssertOptions: [String: Any]? = {
|
|
|
[AVURLAssetPreferPreciseDurationAndTimingKey: NSNumber(value: true)]
|
|
|
}()
|
|
|
|
|
|
/// 播放动画图
|
|
|
-var playGifImages: [UIImage] = {
|
|
|
+public var playGifImages: [UIImage] = {
|
|
|
var gifImages = Array<UIImage>.init()
|
|
|
for i in 0 ... 44 {
|
|
|
gifImages.append(UIImage(named: "\(i).png")!)
|