import { api } from './request'; export interface UserInfo { id: string; name: string; phone: string; avatar?: string; tenant_id: string; } export interface LoginResp { bound: boolean; openid: string; token?: { access_token: string; refresh_token: string; expires_in: number; user: { id: string; username: string; display_name?: string; phone?: string; avatar_url?: string }; }; } export interface PatientInfo { id: string; name: string; gender?: string; birth_date?: string; relation: string; } export async function wechatLogin(code: string): Promise { return api.post('/auth/wechat/login', { code }); } export async function wechatBindPhone(openid: string, encryptedData: string, iv: string) { return api.post('/auth/wechat/bind-phone', { openid, encrypted_data: encryptedData, iv, }); } export async function getPatients() { return api.get('/health/patients'); } /** 开发模式:用户名密码直登 */ export async function devLogin(username: string, password: string) { return api.post('/auth/login', { username, password }); }