import request from '@/utils/request'

/** 登录 */
export function login(username, password, code, uuid) {
  return request({
    url: '/login',
    method: 'POST',
    header: { isToken: false, repeatSubmit: false },
    data: { username, password, code, uuid }
  })
}

/** 获取当前用户信息 */
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'GET'
  })
}

/** 退出登录 */
export function logout() {
  return request({
    url: '/logout',
    method: 'POST'
  })
}

/** 图形验证码 */
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    method: 'GET',
    header: { isToken: false },
    timeout: 20000
  })
}
