update
This commit is contained in:
Binary file not shown.
@@ -28,8 +28,8 @@ open class RequestList {
|
|||||||
return DDAF.post(urlString: HOST+API.login,parameters: parameters,headers: ["Authorization":"Basic c3VwcGxpZXItYXBwOiQyYSQxMCRXZ1pIdzVSamoxcGpIYnJucG00YlYuTWlTZ0o2aWpzYWlNeHN2OUhwZWlYR094UWtWRWVaNg=="],responseType: ResponseModel<LoginDataModel>.self)
|
return DDAF.post(urlString: HOST+API.login,parameters: parameters,headers: ["Authorization":"Basic c3VwcGxpZXItYXBwOiQyYSQxMCRXZ1pIdzVSamoxcGpIYnJucG00YlYuTWlTZ0o2aWpzYWlNeHN2OUhwZWlYR094UWtWRWVaNg=="],responseType: ResponseModel<LoginDataModel>.self)
|
||||||
}
|
}
|
||||||
|
|
||||||
func token(parameters:Encodable) -> Single<ResponseModel<String>?> {
|
func token(parameters:Encodable) -> Single<ResponseModel<LoginDataModel>?> {
|
||||||
return DDAF.post(urlString: HOST+API.token,parameters: parameters,headers: ["Authorization":"Basic c3VwcGxpZXItYXBwOiQyYSQxMCRXZ1pIdzVSamoxcGpIYnJucG00YlYuTWlTZ0o2aWpzYWlNeHN2OUhwZWlYR094UWtWRWVaNg=="],responseType: ResponseModel<String>.self)
|
return DDAF.post(urlString: HOST+API.token,parameters: parameters,headers: ["Authorization":"Basic c3VwcGxpZXItYXBwOiQyYSQxMCRXZ1pIdzVSamoxcGpIYnJucG00YlYuTWlTZ0o2aWpzYWlNeHN2OUhwZWlYR094UWtWRWVaNg=="],responseType: ResponseModel<LoginDataModel>.self)
|
||||||
}
|
}
|
||||||
|
|
||||||
func logout(parameters:Encodable) -> Single<ResponseModel<String>?> {
|
func logout(parameters:Encodable) -> Single<ResponseModel<String>?> {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class LoginDataModel : Decodable {
|
|||||||
var expiresAt : Double?
|
var expiresAt : Double?
|
||||||
}
|
}
|
||||||
public class LoginDataAdditionalModel: Decodable {
|
public class LoginDataAdditionalModel: Decodable {
|
||||||
var user_info : LoginDataAdditionalUserModel
|
var user_info : LoginDataAdditionalUserModel?
|
||||||
}
|
}
|
||||||
public class LoginDataAdditionalUserModel: Decodable {
|
public class LoginDataAdditionalUserModel: Decodable {
|
||||||
var userId : Int
|
var userId : Int
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ extension LoginController {
|
|||||||
if let token = responseModel?.data?.accessToken.tokenValue {
|
if let token = responseModel?.data?.accessToken.tokenValue {
|
||||||
USER.setToken(token: token)
|
USER.setToken(token: token)
|
||||||
USER.setRefreshToken(token: responseModel?.data?.refreshToken.tokenValue)
|
USER.setRefreshToken(token: responseModel?.data?.refreshToken.tokenValue)
|
||||||
USER.setSupplierType(supplierType: responseModel?.data?.additionalParameters.user_info.supplierType)
|
USER.setSupplierType(supplierType: responseModel?.data?.additionalParameters.user_info?.supplierType)
|
||||||
USER.setPhone(phone: self?.loginView.phoneView.textfield.text)
|
USER.setPhone(phone: self?.loginView.phoneView.textfield.text)
|
||||||
USER.setSupplierName(supplierName: self?.loginView.serviceProviderView.textfield.text)
|
USER.setSupplierName(supplierName: self?.loginView.serviceProviderView.textfield.text)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user