Alamofire 框架使用 carthage 更新 xcode 版本是 14.2
func getUserInfo(clientInfo: ClientInfo,
accessToken: String,
completionHandler: @escaping AuthCompletion) {
var urlRequest: URLRequestConvertible?
switch clientInfo.loginType {
case .iam:
urlRequest = router.requestIAMUserInfo(clientInfo, accessToken)
case .sso:
urlRequest = router.requestSSOUserInfo(clientInfo, accessToken)
}
if urlRequest != nil {
// Can force unwrap since checking for nil
Alamofire.request(urlRequest!)
.responseJSON { response in
guard let data = response.data else {
completionHandler(nil, nil)
return
}
completionHandler(data as AnyObject, nil)
}
}
}