jsdw_ios/QuickLocation/Service/UserService.swift

37 lines
1.1 KiB
Swift
Raw 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: weixin、phone、apple、onekey、device、alipay
/// - bind:1绑定 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 logout() -> Observable<ResponseModel> {
let api = UserAPI.logout.multiTarget
return APIProvider.request(token: api)
.map(ResponseModel.self)
.asObservable()
}
}