import { apiClient } from './client' export interface AuthUser { id: number phone: string nickname: string realname_status: string risk_status: string credit_score: number status: string } export interface TokenPair { access_token: string refresh_token: string token_type: string expires_in: number } export interface LoginData { user: AuthUser tokens: TokenPair } interface ApiResponse { code: string message: string data: T } export async function sendSmsCode(phone: string) { const { data } = await apiClient.post>('/auth/sms/send', { phone, }) return data.data } export async function loginWithSms(phone: string, code: string) { const { data } = await apiClient.post>('/auth/sms/login', { phone, code }) return data.data } export async function fetchMe() { const { data } = await apiClient.get>('/me') return data.data }