import client from '../client' import type { LoginResponse, LogoutResponse, RegisterResponse } from '../types/auth' import type { CheckLoginResponse } from '../types/user' export function checkLogin() { return client.get('/api/check-login').then((r) => r.data) } export function postLogin(login_name: string, login_pwd: string) { return client.post('/api/login', { login_name, login_pwd }).then((r) => r.data) } export function postLogout() { return client.post('/api/logout', {}).then((r) => r.data) } export interface RegisterBody { login_name: string login_pwd: string nickname: string email?: string mobile?: string sex?: number } export function postRegister(body: RegisterBody) { return client.post('/api/register', body).then((r) => r.data) }