diff --git a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate
index c186676..9dc74de 100644
Binary files a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate and b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index e22a5af..f15e02e 100644
--- a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -3569,22 +3569,6 @@
landmarkType = "7">
-
-
-
-
-
-
-
-
-
-
-
-
@@ -4903,8 +4855,8 @@
filePath = "OrderScheduling/Global/User/UserPermission.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "36"
- endingLineNumber = "36"
+ startingLineNumber = "33"
+ endingLineNumber = "33"
landmarkName = "init()"
landmarkType = "7">
@@ -4941,5 +4893,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage.png b/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage.png
index 2e3df52..6be712b 100644
Binary files a/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage.png and b/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage.png differ
diff --git a/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@2x.png b/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@2x.png
index bf049ef..d95ed3f 100644
Binary files a/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@2x.png and b/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@2x.png differ
diff --git a/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@3x.png b/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@3x.png
index b878d6a..e17f572 100644
Binary files a/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@3x.png and b/OrderScheduling/Assets.xcassets/Login/login_backgroundImage.imageset/login_backgroundImage@3x.png differ
diff --git a/OrderScheduling/Global/User/UserPermission.swift b/OrderScheduling/Global/User/UserPermission.swift
index ad3211e..923b066 100644
--- a/OrderScheduling/Global/User/UserPermission.swift
+++ b/OrderScheduling/Global/User/UserPermission.swift
@@ -25,103 +25,94 @@ open class UserPermission {
public var canSupplierRemarkBtn : Bool = false
public var canSupplierAuditEditCostBtn : Bool = false
public var canSupplierAuditUploadPhotoBtn : Bool = false
- lazy private var alert = CommonAlertView()
+ private let maxRetryCount = 120
+
init() {
Observable.combineLatest(relay, USER.refreshTokenSub)
- .observe(on: MainScheduler.instance)
- .do(onNext: { (_,_) in
- UIApplication.shared.dd_keyWindow.rootViewController?.view.dd_showHUD()
- })
.flatMapLatest { (_,_) in
return RQ.userOperationPermissions()
}
- .observe(on: MainScheduler.instance)
- .do(onNext: { _ in
- UIApplication.shared.dd_keyWindow.rootViewController?.view.dd_hideHUD()
+ .retry(when: { (rxError: Observable) -> Observable in
+ return rxError.enumerated().flatMap({[weak self] (index,error) -> Observable in
+ guard index < (self?.maxRetryCount ?? 0) else {
+ return Observable.error(error)
+ }
+ return Observable.timer(RxTimeInterval.seconds(5), scheduler: MainScheduler.instance)
+
+ })
})
.observe(on: MainScheduler.instance)
.subscribe(onNext: {[weak self] response in
if response?.success == true {
- self?.canRejectDispatchHandle = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.rejectDispatchHandle.rawValue
}) == true {
self?.canRejectDispatchHandle = true
+ }else{
+ self?.canRejectDispatchHandle = false
}
- self?.canAcceptDispatchHandle = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.acceptDispatchHandle.rawValue
}) == true {
self?.canAcceptDispatchHandle = true
+ }else{
+ self?.canAcceptDispatchHandle = false
}
- self?.canWaitdispatchBtn = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.waitdispatchBtn.rawValue
}) == true {
self?.canWaitdispatchBtn = true
+ }else{
+ self?.canWaitdispatchBtn = false
}
- self?.canWaitModifyDispatchBtn = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.waitModifyDispatchBtn.rawValue
}) == true {
self?.canWaitModifyDispatchBtn = true
+ }else{
+ self?.canWaitModifyDispatchBtn = false
}
- self?.canDealWith = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.dealWith.rawValue
}) == true {
self?.canDealWith = true
+ }else{
+ self?.canDealWith = false
}
- self?.canSupplierRemarkBtn = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.supplierRemarkBtn.rawValue
}) == true {
self?.canSupplierRemarkBtn = true
+ }else{
+ self?.canSupplierRemarkBtn = false
}
- self?.canSupplierAuditEditCostBtn = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.supplierAuditEditCostBtn.rawValue
}) == true {
self?.canSupplierAuditEditCostBtn = true
+ }else{
+ self?.canSupplierAuditEditCostBtn = false
}
- self?.canSupplierAuditUploadPhotoBtn = false
if response?.data?.contains(where: { value in
value == UserOperationPermissionsDataModel.DataEnum.supplierAuditUploadPhotoBtn.rawValue
}) == true {
self?.canSupplierAuditUploadPhotoBtn = true
+ }else{
+ self?.canSupplierAuditUploadPhotoBtn = false
}
self?.userPermissionRelay.accept(response?.data)
- }else{
- if let alert = self?.alert {
- alert.contentLabel.text = notObtainUserPermissions
- ENTRY.showUserPermissionsEntry(view: alert,name: notObtainUserPermissionsEntry)
- }
}
- })
- .disposed(by: disposeBag)
-
- alert.sureButton.rx.tap
- .observe(on: MainScheduler.instance)
- .subscribe(onNext: {[weak self] _ in
- ENTRY.dismiss(name: notObtainUserPermissionsEntry) {[weak self] in
- self?.relay.accept(nil)
- }
- })
- .disposed(by: disposeBag)
-
- alert.cancelButton.rx.tap
- .observe(on: MainScheduler.instance)
- .subscribe(onNext: { _ in
- exit(0)
+ },onError: { error in
+
})
.disposed(by: disposeBag)
}
diff --git a/OrderScheduling/HttpRequestCenter/RequestList.swift b/OrderScheduling/HttpRequestCenter/RequestList.swift
index 75a3be6..b8beef3 100644
--- a/OrderScheduling/HttpRequestCenter/RequestList.swift
+++ b/OrderScheduling/HttpRequestCenter/RequestList.swift
@@ -15,6 +15,9 @@ public let RQ = RequestList.default
open class RequestList {
public static let `default` = RequestList()
+ struct DDError : Error {
+ }
+
func tokenHeader() -> HTTPHeader {
let httpHeader = HTTPHeader.init(name: "Authorization", value: USER.token ?? "")
return httpHeader
@@ -109,7 +112,13 @@ open class RequestList {
}
func userOperationPermissions() -> Single?> {
- return DDAF.post(urlString: HOST+API.userOperationPermissions,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<[String]>.self)
+ return DDAF.post(urlString: HOST+API.userOperationPermissions,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<[String]>.self) { single, response in
+ if response.value?.success == true {
+ single(.success(response.value))
+ }else{
+ single(.failure(DDError()))
+ }
+ }
}
func vehicleLogout(parameters:P) -> Single?> {
diff --git a/Podfile.lock b/Podfile.lock
index c26efa5..9a0af78 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -1,5 +1,5 @@
PODS:
- - Alamofire (5.7.1)
+ - Alamofire (5.8.1)
- AMapFoundation-NO-IDFA (1.8.2)
- AMapLocation-NO-IDFA (2.9.0):
- AMapFoundation-NO-IDFA (>= 1.7.0)
@@ -270,7 +270,7 @@ PODS:
- DDLogKit_Private
- DDMAMapKit_Private/DDMAUtil (0.1.5):
- DDMAMapKit_Private/DDMAMap
- - DDNetworkingOfAlamofireKit_Private (0.1.8):
+ - DDNetworkingOfAlamofireKit_Private (0.2.1):
- Alamofire
- DDLogKit_Private
- RxSwift
@@ -412,7 +412,7 @@ SPEC REPOS:
- ZLPhotoBrowser
SPEC CHECKSUMS:
- Alamofire: 0123a34370cb170936ae79a8df46cc62b2edeb88
+ Alamofire: 3ca42e259043ee0dc5c0cdd76c4bc568b8e42af7
AMapFoundation-NO-IDFA: 6ce0ef596d4eb8d934ff498e56747b6de1247b05
AMapLocation-NO-IDFA: 6839d1543b3138ae594ddd36ab72741dc87df66f
AMapNavi-NO-IDFA: 70c724400376bfadcb8ec08b9761f526096cfdb6
@@ -430,7 +430,7 @@ SPEC CHECKSUMS:
DDFontKit_Private: 7b8f4ebf0f60622874036202734d8460dc7b3806
DDLogKit_Private: 1ed442cc7be004bd05f27bfda9b525e113df54e0
DDMAMapKit_Private: b378d69f693d6998d136155cd5c81be2e4545fae
- DDNetworkingOfAlamofireKit_Private: d65c96f99bc59311d374e7b7a7e8a9e042d9b5ea
+ DDNetworkingOfAlamofireKit_Private: 652eb70a7d8bac81d77d036fabeb52f807120f6d
DDPersistenceKit_Private: c150822543ffa6ece3900178629812f64902ed90
DDProgressHUDKit_Private: 1e219062ddeb7801a4bb13b367efa1f3fbf17f1e
DDTimerSwiftKit_Private: cce3fe58b1b581fe4cddb3fb84fcde31b4e83541
diff --git a/Pods/Alamofire/README.md b/Pods/Alamofire/README.md
index b0ba4d5..c9adb9f 100644
--- a/Pods/Alamofire/README.md
+++ b/Pods/Alamofire/README.md
@@ -1,11 +1,10 @@

-[](https://img.shields.io/badge/Swift-5.5_5.6_5.7_5.8-Orange?style=flat-square)
-[](https://img.shields.io/badge/Platforms-macOS_iOS_tvOS_watchOS_Linux_Windows-Green?style=flat-square)
+[](https://img.shields.io/badge/Swift-5.6_5.7_5.8_5.9-Orange?style=flat-square)
+[](https://img.shields.io/badge/Platforms-macOS_iOS_tvOS_watchOS_vision_OS_Linux_Windows_Android-Green?style=flat-square)
[](https://img.shields.io/cocoapods/v/Alamofire.svg)
[](https://github.com/Carthage/Carthage)
[](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)
-[](https://twitter.com/AlamofireSF)
[](https://forums.swift.org/c/related-projects/alamofire/37)
Alamofire is an HTTP networking library written in Swift.
@@ -52,6 +51,33 @@ Alamofire is an HTTP networking library written in Swift.
- [x] Comprehensive Unit and Integration Test Coverage
- [x] [Complete Documentation](https://alamofire.github.io/Alamofire)
+## Write Requests Fast!
+
+Alamofire's compact syntax and extensive feature set allow requests with powerful features like automatic retry to be written in just a few lines of code.
+
+```swift
+// Automatic String to URL conversion, Swift concurrency support, and automatic retry.
+let response = await AF.request("https://httpbin.org/get", interceptor: .retryPolicy)
+ // Automatic HTTP Basic Auth.
+ .authenticate(username: "user", password: "pass")
+ // Caching customization.
+ .cacheResponse(using: .cache)
+ // Redirect customization.
+ .redirect(using: .follow)
+ // Validate response code and Content-Type.
+ .validate()
+ // Produce a cURL command for the request.
+ .cURLDescription { description in
+ print(description)
+ }
+ // Automatic Decodable support with background parsing.
+ .serializingDecodable(DecodableType.self)
+ // Await the full response with metrics and a parsed body.
+ .response
+// Detailed response description for easy debugging.
+debugPrint(response)
+```
+
## Component Libraries
In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem.
@@ -61,21 +87,23 @@ In order to keep Alamofire focused specifically on core networking implementatio
## Requirements
-| Platform | Minimum Swift Version | Installation | Status |
-| --- | --- | --- | --- |
-| iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+ | 5.5 | [CocoaPods](#cocoapods), [Carthage](#carthage), [Swift Package Manager](#swift-package-manager), [Manual](#manually) | Fully Tested |
-| Linux | Latest Only | [Swift Package Manager](#swift-package-manager) | Building But Unsupported |
-| Windows | Latest Only | [Swift Package Manager](#swift-package-manager) | Building But Unsupported |
+| Platform | Minimum Swift Version | Installation | Status |
+| ---------------------------------------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------ |
+| iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+ | 5.6 | [CocoaPods](#cocoapods), [Carthage](#carthage), [Swift Package Manager](#swift-package-manager), [Manual](#manually) | Fully Tested |
+| Linux | Latest Only | [Swift Package Manager](#swift-package-manager) | Building But Unsupported |
+| Windows | Latest Only | [Swift Package Manager](#swift-package-manager) | Building But Unsupported |
+| Android | Latest Only | [Swift Package Manager](#swift-package-manager) | Building But Unsupported |
#### Known Issues on Linux and Windows
-Alamofire builds on Linux and Windows but there are missing features and many issues in the underlying `swift-corelibs-foundation` that prevent full functionality and may cause crashes. These include:
+Alamofire builds on Linux, Windows, and Android but there are missing features and many issues in the underlying `swift-corelibs-foundation` that prevent full functionality and may cause crashes. These include:
+
- `ServerTrustManager` and associated certificate functionality is unavailable, so there is no certificate pinning and no client certificate support.
- Various methods of HTTP authentication may crash, including HTTP Basic and HTTP Digest. Crashes may occur if responses contain server challenges.
- Cache control through `CachedResponseHandler` and associated APIs is unavailable, as the underlying delegate methods aren't called.
- `URLSessionTaskMetrics` are never gathered.
-Due to these issues, Alamofire is unsupported on Linux and Windows. Please report any crashes to the [Swift bug reporter](https://bugs.swift.org).
+Due to these issues, Alamofire is unsupported on Linux, Windows, and Android. Please report any crashes to the [Swift bug reporter](https://bugs.swift.org).
## Migration Guides
@@ -85,11 +113,12 @@ Due to these issues, Alamofire is unsupported on Linux and Windows. Please repor
- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md)
## Communication
+
- If you **need help with making network requests** using Alamofire, use [Stack Overflow](https://stackoverflow.com/questions/tagged/alamofire) and tag `alamofire`.
- If you need to **find or understand an API**, check [our documentation](http://alamofire.github.io/Alamofire/) or [Apple's documentation for `URLSession`](https://developer.apple.com/documentation/foundation/url_loading_system), on top of which Alamofire is built.
- If you need **help with an Alamofire feature**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire).
- If you'd like to **discuss Alamofire best practices**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire).
-- If you'd like to **discuss a feature request**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire).
+- If you'd like to **discuss a feature request**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire).
- If you **found a bug**, open an issue here on GitHub and follow the guide. The more detail the better!
## Installation
@@ -112,13 +141,13 @@ github "Alamofire/Alamofire"
### Swift Package Manager
-The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.
+The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
```swift
dependencies: [
- .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.6.4"))
+ .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.8.1"))
]
```
@@ -142,7 +171,7 @@ If you prefer not to use any of the aforementioned dependency managers, you can
- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project.
- > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.
+ > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.
- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target.
- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
@@ -150,11 +179,11 @@ If you prefer not to use any of the aforementioned dependency managers, you can
- Click on the `+` button under the "Embedded Binaries" section.
- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder.
- > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`.
+ > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`.
- Select the top `Alamofire.framework` for iOS and the bottom one for macOS.
- > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS`, or `Alamofire watchOS`.
+ > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS`, or `Alamofire watchOS`.
- And that's it!
diff --git a/Pods/Alamofire/Source/AFError.swift b/Pods/Alamofire/Source/AFError.swift
index 8cd60c7..82a75b5 100644
--- a/Pods/Alamofire/Source/AFError.swift
+++ b/Pods/Alamofire/Source/AFError.swift
@@ -24,6 +24,10 @@
import Foundation
+#if canImport(Security)
+import Security
+#endif
+
/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with
/// their own associated reasons.
public enum AFError: Error {
@@ -129,7 +133,7 @@ public enum AFError: Error {
case invalidEmptyResponse(type: String)
}
- #if !(os(Linux) || os(Windows))
+ #if canImport(Security)
/// Underlying reason a server trust evaluation error occurred.
public enum ServerTrustFailureReason {
/// The output of a server trust evaluation.
@@ -211,7 +215,7 @@ public enum AFError: Error {
case responseValidationFailed(reason: ResponseValidationFailureReason)
/// Response serialization failed.
case responseSerializationFailed(reason: ResponseSerializationFailureReason)
- #if !(os(Linux) || os(Windows))
+ #if canImport(Security)
/// `ServerTrustEvaluating` instance threw an error during trust evaluation.
case serverTrustEvaluationFailed(reason: ServerTrustFailureReason)
#endif
@@ -314,7 +318,7 @@ extension AFError {
return false
}
- #if !(os(Linux) || os(Windows))
+ #if canImport(Security)
/// Returns whether the instance is `.serverTrustEvaluationFailed`. When `true`, the `underlyingError` property will
/// contain the associated value.
public var isServerTrustEvaluationError: Bool {
@@ -393,7 +397,7 @@ extension AFError {
return reason.underlyingError
case let .responseSerializationFailed(reason):
return reason.underlyingError
- #if !(os(Linux) || os(Windows))
+ #if canImport(Security)
case let .serverTrustEvaluationFailed(reason):
return reason.underlyingError
#endif
@@ -451,7 +455,7 @@ extension AFError {
return destination
}
- #if !(os(Linux) || os(Windows))
+ #if canImport(Security)
/// The download resume data of any underlying network error. Only produced by `DownloadRequest`s.
public var downloadResumeData: Data? {
(underlyingError as? URLError)?.userInfo[NSURLSessionDownloadTaskResumeData] as? Data
@@ -610,7 +614,7 @@ extension AFError.ResponseSerializationFailureReason {
}
}
-#if !(os(Linux) || os(Windows))
+#if canImport(Security)
extension AFError.ServerTrustFailureReason {
var output: AFError.ServerTrustFailureReason.Output? {
switch self {
@@ -688,7 +692,7 @@ extension AFError: LocalizedError {
"""
case let .sessionInvalidated(error):
return "Session was invalidated with error: \(error?.localizedDescription ?? "No description.")"
- #if !(os(Linux) || os(Windows))
+ #if canImport(Security)
case let .serverTrustEvaluationFailed(reason):
return "Server trust evaluation failed due to reason: \(reason.localizedDescription)"
#endif
@@ -822,7 +826,7 @@ extension AFError.ResponseValidationFailureReason {
}
}
-#if !(os(Linux) || os(Windows))
+#if canImport(Security)
extension AFError.ServerTrustFailureReason {
var localizedDescription: String {
switch self {
diff --git a/Pods/Alamofire/Source/Alamofire.swift b/Pods/Alamofire/Source/Alamofire.swift
index 52ea3de..c99fe49 100644
--- a/Pods/Alamofire/Source/Alamofire.swift
+++ b/Pods/Alamofire/Source/Alamofire.swift
@@ -37,4 +37,4 @@ import Foundation
public let AF = Session.default
/// Current Alamofire version. Necessary since SPM doesn't use dynamic libraries. Plus this will be more accurate.
-let version = "5.7.1"
+let version = "5.8.0"
diff --git a/Pods/Alamofire/Source/AuthenticationInterceptor.swift b/Pods/Alamofire/Source/AuthenticationInterceptor.swift
index c3a3f31..5c88287 100644
--- a/Pods/Alamofire/Source/AuthenticationInterceptor.swift
+++ b/Pods/Alamofire/Source/AuthenticationInterceptor.swift
@@ -217,15 +217,14 @@ public class AuthenticationInterceptor: RequestInterceptor wh
/// The `Credential` used to authenticate requests.
public var credential: Credential? {
- get { $mutableState.credential }
- set { $mutableState.credential = newValue }
+ get { mutableState.credential }
+ set { mutableState.credential = newValue }
}
let authenticator: AuthenticatorType
let queue = DispatchQueue(label: "org.alamofire.authentication.inspector")
- @Protected
- private var mutableState: MutableState
+ private let mutableState: Protected
// MARK: Initialization
@@ -242,13 +241,13 @@ public class AuthenticationInterceptor: RequestInterceptor wh
credential: Credential? = nil,
refreshWindow: RefreshWindow? = RefreshWindow()) {
self.authenticator = authenticator
- mutableState = MutableState(credential: credential, refreshWindow: refreshWindow)
+ mutableState = Protected(MutableState(credential: credential, refreshWindow: refreshWindow))
}
// MARK: Adapt
public func adapt(_ urlRequest: URLRequest, for session: Session, completion: @escaping (Result) -> Void) {
- let adaptResult: AdaptResult = $mutableState.write { mutableState in
+ let adaptResult: AdaptResult = mutableState.write { mutableState in
// Queue the adapt operation if a refresh is already in place.
guard !mutableState.isRefreshing else {
let operation = AdaptOperation(urlRequest: urlRequest, session: session, completion: completion)
@@ -316,7 +315,7 @@ public class AuthenticationInterceptor: RequestInterceptor wh
return
}
- $mutableState.write { mutableState in
+ mutableState.write { mutableState in
mutableState.requestsToRetry.append(completion)
guard !mutableState.isRefreshing else { return }
@@ -340,7 +339,7 @@ public class AuthenticationInterceptor: RequestInterceptor wh
// Dispatch to queue to hop out of the lock in case authenticator.refresh is implemented synchronously.
queue.async {
self.authenticator.refresh(credential, for: session) { result in
- self.$mutableState.write { mutableState in
+ self.mutableState.write { mutableState in
switch result {
case let .success(credential):
self.handleRefreshSuccess(credential, insideLock: &mutableState)
diff --git a/Pods/Alamofire/Source/Combine.swift b/Pods/Alamofire/Source/Combine.swift
index 08329fc..79fce0d 100644
--- a/Pods/Alamofire/Source/Combine.swift
+++ b/Pods/Alamofire/Source/Combine.swift
@@ -22,7 +22,7 @@
// THE SOFTWARE.
//
-#if !((os(iOS) && (arch(i386) || arch(arm))) || os(Windows) || os(Linux))
+#if !((os(iOS) && (arch(i386) || arch(arm))) || os(Windows) || os(Linux) || os(Android))
import Combine
import Dispatch
@@ -91,23 +91,22 @@ public struct DataResponsePublisher: Publisher {
where Downstream.Input == Output {
typealias Failure = Downstream.Failure
- @Protected
- private var downstream: Downstream?
+ private let downstream: Protected
private let request: DataRequest
private let responseHandler: Handler
init(request: DataRequest, responseHandler: @escaping Handler, downstream: Downstream) {
self.request = request
self.responseHandler = responseHandler
- self.downstream = downstream
+ self.downstream = Protected(downstream)
}
func request(_ demand: Subscribers.Demand) {
assert(demand > 0)
- guard let downstream = downstream else { return }
+ guard let downstream = downstream.read({ $0 }) else { return }
- self.downstream = nil
+ self.downstream.write(nil)
responseHandler { response in
_ = downstream.receive(response)
downstream.receive(completion: .finished)
@@ -116,7 +115,7 @@ public struct DataResponsePublisher: Publisher {
func cancel() {
request.cancel()
- downstream = nil
+ downstream.write(nil)
}
}
}
@@ -312,23 +311,22 @@ public struct DataStreamPublisher: Publisher {
where Downstream.Input == Output {
typealias Failure = Downstream.Failure
- @Protected
- private var downstream: Downstream?
+ private let downstream: Protected
private let request: DataStreamRequest
private let streamHandler: Handler
init(request: DataStreamRequest, streamHandler: @escaping Handler, downstream: Downstream) {
self.request = request
self.streamHandler = streamHandler
- self.downstream = downstream
+ self.downstream = Protected(downstream)
}
func request(_ demand: Subscribers.Demand) {
assert(demand > 0)
- guard let downstream = downstream else { return }
+ guard let downstream = downstream.read({ $0 }) else { return }
- self.downstream = nil
+ self.downstream.write(nil)
streamHandler { stream in
_ = downstream.receive(stream)
if case .complete = stream.event {
@@ -339,7 +337,7 @@ public struct DataStreamPublisher: Publisher {
func cancel() {
request.cancel()
- downstream = nil
+ downstream.write(nil)
}
}
}
@@ -462,23 +460,22 @@ public struct DownloadResponsePublisher: Publisher {
where Downstream.Input == Output {
typealias Failure = Downstream.Failure
- @Protected
- private var downstream: Downstream?
+ private let downstream: Protected
private let request: DownloadRequest
private let responseHandler: Handler
init(request: DownloadRequest, responseHandler: @escaping Handler, downstream: Downstream) {
self.request = request
self.responseHandler = responseHandler
- self.downstream = downstream
+ self.downstream = Protected(downstream)
}
func request(_ demand: Subscribers.Demand) {
assert(demand > 0)
- guard let downstream = downstream else { return }
+ guard let downstream = downstream.read({ $0 }) else { return }
- self.downstream = nil
+ self.downstream.write(nil)
responseHandler { response in
_ = downstream.receive(response)
downstream.receive(completion: .finished)
@@ -487,7 +484,7 @@ public struct DownloadResponsePublisher: Publisher {
func cancel() {
request.cancel()
- downstream = nil
+ downstream.write(nil)
}
}
}
diff --git a/Pods/Alamofire/Source/Concurrency.swift b/Pods/Alamofire/Source/Concurrency.swift
index 95008f9..21e7e1e 100644
--- a/Pods/Alamofire/Source/Concurrency.swift
+++ b/Pods/Alamofire/Source/Concurrency.swift
@@ -37,7 +37,7 @@ extension Request {
/// - Returns: The `StreamOf