feat(auth): support captcha login
This commit is contained in:
@@ -4,6 +4,7 @@ import { ApiResponseError, unwrapApiResponse } from '@/utils/api-response'
|
||||
import { request } from '@/utils/request'
|
||||
import type {
|
||||
AuthenticatedUser,
|
||||
CaptchaResponse,
|
||||
CurrentUserResponse,
|
||||
LoginRequest,
|
||||
LoginResponse,
|
||||
@@ -12,6 +13,11 @@ import type { ApiResponse } from '@/types/common'
|
||||
|
||||
export { ApiResponseError } from '@/utils/api-response'
|
||||
|
||||
export async function getCaptcha(): Promise<CaptchaResponse> {
|
||||
const response = await request.get<ApiResponse<CaptchaResponse>>('/v1/auth/captcha')
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
function normalizePermissions(value: unknown): string[] {
|
||||
if (Array.isArray(value)) {
|
||||
return value.filter((item): item is string => typeof item === 'string')
|
||||
|
||||
Reference in New Issue
Block a user