| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // LNHttpManager+Login.swift
- // Lanu
- //
- // Created by OneeChan on 2025/11/11.
- //
- import Foundation
- private let kNetPath_Login_Google = "/user/login/google/enter"
- private let kNetPath_Login_Email = "/user/login/email/enter"
- private let kNetPath_Login_Apple = "/user/login/apple/enter"
- private let kNetPath_Login_Refresh = "/user/renewalToken"
- private let kNetPath_Logout = "/user/logout"
- extension LNHttpManager {
- func loginByGoogle(token: String, completion: @escaping (LNLoginResponse?, LNHttpError?) -> Void) {
- post(path: kNetPath_Login_Google, params: ["data": token], completion: completion)
- }
-
- func loginByApple(token: String, completion: @escaping (LNLoginResponse?, LNHttpError?) -> Void) {
- post(path: kNetPath_Login_Apple, params: ["data": token], completion: completion)
- }
-
- #if DEBUG
- func loginByEmail(email: String, completion: @escaping (LNLoginResponse?, LNHttpError?) -> Void) {
- post(path: kNetPath_Login_Email, params: ["email": email], completion: completion)
- }
- #endif
-
- func refreshToken(completion: @escaping (LNRefreshTokenResponse?, LNHttpError?) -> Void) {
- post(path: kNetPath_Login_Refresh, completion: completion)
- }
-
- func logout(completion: @escaping (LNHttpError?) -> Void) {
- post(path: kNetPath_Logout, completion: completion)
- }
- }
|