import http from '@/api' import type { BaseEntity } from '@/typings/api' export interface UserInfo extends BaseEntity { name: string sex: number username: string avatar: string email: string phone: string } export interface LoginForm { username: string password: string code: string uuid: string } export interface AuthResponse { accessToken: string refreshToken: string expiresIn: number tokenType: string scope: string[] } export interface VerificationCode { img: string uuid: string } /** * 登录 * @param loginForm */ export const login = (loginForm: LoginForm) => { return http.post('/auth/login', loginForm) } /** * 退出 */ export const logout = () => { return http.post('/auth/logout') } /** * 刷新token */ export const refreshToken = () => { return http.post('/auth/refresh') } /** * 获取验证码 */ export const getCodeImg = () => { return http.get('/auth/code') } /** * 获取用户信息 */ export const getInfo = () => { return http.get('/auth/info') }