import request from '@/utils/request'

export function login(username, password) {
  const config = {
    url: '/user/login',
    method: 'post',
    data: {
      'loginName': username,
      'code': password
    }
  }

  return request(config)
}

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

// 注销登录
export function logOut() {
  return request({
    url: '/user/logOut',
    method: 'post'
  })
}

// 发送验证码
export function sendCode(phone) {
  return request({
    url: '/code/sendCode',
    method: 'post',
    params: { phone }
  })
}
