feat: 支持多因素认证登录,更新相关类型定义

This commit is contained in:
siujamo
2026-01-28 17:05:38 +08:00
parent d5109e1333
commit d5074a92a2
5 changed files with 62 additions and 69 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import webClient from "@/client/web-client"
import { HttpStatus } from "@/constant"
import type { CaptchaResponse, UserAuthResponse } from "@/types/web/response"
import type { CaptchaResponse, MfaAuthResponse, UserAuthResponse } from "@/types/web/response"
import type { UsernamePasswordLoginRequest } from "@/types/web/request"
/**
@@ -21,8 +21,8 @@ async function getCaptcha(): Promise<CaptchaResponse | null> {
*/
async function usernamePasswordLogin(
request: UsernamePasswordLoginRequest
): Promise<UserAuthResponse | null> {
const { data } = await webClient.post<UserAuthResponse>("/auth/login", request)
): Promise<UserAuthResponse | MfaAuthResponse | null> {
const { data } = await webClient.post<UserAuthResponse | MfaAuthResponse>("/auth/login", request)
return data
}