mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
21 lines
398 B
TypeScript
21 lines
398 B
TypeScript
import { fetchApi } from '@/utils/request'
|
|
|
|
export interface LoginRequest {
|
|
username: string
|
|
password: string
|
|
}
|
|
|
|
export interface LoginResponse {
|
|
access_token: string
|
|
user_id: string
|
|
username: string
|
|
}
|
|
|
|
export async function login(data: LoginRequest): Promise<LoginResponse> {
|
|
return fetchApi<LoginResponse>('/auth/login', {
|
|
method: 'POST',
|
|
body: data,
|
|
noAuth: true,
|
|
})
|
|
}
|