import { Login } from '@/api/interface/index'
import http from '@/api'

/**
 * @name 登录模块
 */
// 用户登录
export const loginApi = (params: Login.ReqLoginForm) => {
  return http.post<Login.ResLogin>('/auth/login', params, { loading: true, isEncrypt: true }) // 正常 post json 请求  ==>  application/json
}

// 用户退出登录
export const logoutApi = () => {
  return http.post('/auth/logout', {}, { loading: false })
}

// 用户退出登录
export const getInfoApi = () => {
  return http.get('/system/user/getInfo', {}, { loading: false })
}
// 用户退出登录
export const getCodeImg = () => {
  return http.get('/captchaImage', {}, { loading: false })
}
