import http from '@/axios'
import { LoginData, LoginResult, VerifyCodeResult } from '@/api/interface/login'

class LoginApi {
  static login = (data: LoginData): Promise<ResultData<any>> => {
    return http.post<LoginResult>({ url: '/auth/login', data })
  }

  static logout = (): Promise<ResultData<any>> => {
    return http.post({ url: '/auth/logout' })
  }

  static getCodeImg = (): Promise<ResultData<any>> => {
    return http.get<VerifyCodeResult[]>({ url: '/captchaImage' })
  }
}
export default LoginApi
