import {http} from '@/utils/http'

// 获取图片验证码
export const getCaptcha = () => http.get<Record<string, any>>('/auth/code')

// 根据邮箱查询用户信息
export const getUserInfoByEmail = (data: Record<string, any>) => http.post<Record<string, any>>('/app/user/getByEmail', data)

// 根据手机号查询用户信息
export const getByPhone = (data: Record<string, any>) => http.post<Record<string, any>>('/app/user/getByPhone', data)

// 校验手机号是否被使用
export const checkPhoneUnique = (data: Record<string, any>) => http.post<Record<string, any>>('/app/user/checkPhoneUnique', data)

// 短信验证码
export const smsSend = (data: Record<string, any>) => http.post('/app/sms/send', data)


// 邮箱注册
export const register = (data: Record<string, any>) => http.post<{
    token: string
}>('/app/user/register', data)

// 登录
export const login = (data: Record<string, any>) =>
    http.post<{
        token: string
    }>('/app/login', data)


// 忘记密码
export const forgetPwd = (data: Record<string, any>) => http.post<{
    token: string
}>('/app/user/forgetPwd', data)

