jsdw_ios/QuickLocation/Service/UserService.swift

52 lines
1.5 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// UserService.swift
// QuickLocation
//
// Created by on 2026/5/28.
//
import RxSwift
import Moya
struct UserService {
static let disposeBag = DisposeBag()
///
/// - Parameters:
/// - type: weixinphoneappleonekeydevicealipay
/// - bind1 2
static func login(type: String,
bind: String = "",
data: [String: Any]) -> Observable<UserLoginRespons> {
return APIProvider.request(token: UserAPI.login(type: type,
bind: bind,
data: data).multiTarget,
handle: false)
.map(UserLoginRespons.self)
.asObservable()
}
///
static func userInfo() -> Observable<UserConfigResponse> {
let api = UserAPI.userInfo.multiTarget
return APIProvider.request(token: api)
.map(UserConfigResponse.self)
.asObservable()
}
static func imToken() -> Observable<ResponseModel> {
let api = UserAPI.imToken.multiTarget
return APIProvider.request(token: api)
.map(ResponseModel.self)
.asObservable()
}
/// 退
static func logout() -> Observable<ResponseModel> {
let api = UserAPI.logout.multiTarget
return APIProvider.request(token: api)
.map(ResponseModel.self)
.asObservable()
}
}