import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}

/* 获取验证码 */

export function tailPhone(data) {
  return request({
    url: '/SMS/tailPhone',
    method: 'post',
    data
  })
}

/* 校验验证码 */

export function codeCheckout(data) {
  return request({
    url: 'SMS/codeCheckout',
    method: 'post',
    data
  })
}

/* 提交找回 */
export function updatePassword(data) {
  return request({
    url: 'SMS/updatePassword',
    method: 'post',
    data
  })
}