refactor(api): remove unused network endpoints
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
import { ExceptionHandler } from "@/core/errors";
|
||||
import { ApiError, AuthApi, authApi, ErrorCode } from "@/data/services/api";
|
||||
import {
|
||||
AppleLoginRequest,
|
||||
FacebookLoginRequest,
|
||||
FbIdLoginRequest,
|
||||
GoogleLoginRequest,
|
||||
@@ -16,7 +15,6 @@ import {
|
||||
RefreshTokenRequest,
|
||||
RefreshTokenResponse,
|
||||
RegisterRequest,
|
||||
SendCodeRequest,
|
||||
} from "@/data/dto/auth";
|
||||
import { User } from "@/data/dto/user";
|
||||
import {
|
||||
@@ -94,13 +92,6 @@ export class AuthRepository implements IAuthRepository {
|
||||
});
|
||||
}
|
||||
|
||||
/** 发送邮箱验证码。 */
|
||||
async sendCode(email: string): Promise<Result<void>> {
|
||||
return Result.wrap(async () => {
|
||||
await this.api.sendCode(SendCodeRequest.from({ email }));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出真实用户登录并恢复游客态。
|
||||
*
|
||||
@@ -231,24 +222,6 @@ export class AuthRepository implements IAuthRepository {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apple 登录。
|
||||
* 注:Dart 端另有一个 `uploadFacebookAvatar` 方法,但当前 TS 端 `AuthApi`
|
||||
* 尚未实现该端点,故仓库暂不暴露。等 `AuthApi` 补齐后再加。
|
||||
*/
|
||||
async appleLogin(identityToken: string): Promise<Result<LoginResponse>> {
|
||||
return this._socialLogin(LoginStatus.Apple, () =>
|
||||
this.api.appleLogin(
|
||||
AppleLoginRequest.from(
|
||||
withTestAccountFlag({
|
||||
identityToken,
|
||||
platform: getAuthPlatform(),
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新 token:先读本地的 refresh token,空则直接返回错误;
|
||||
* 调用 API 成功后写回新的 login token + refresh token。
|
||||
|
||||
Reference in New Issue
Block a user