import request from '@/utils/request'
import md5 from 'js-md5'

export function loginByUsername(username, password) {
  var params = new URLSearchParams()
  params.append('account', username)
  params.append('password', md5(password))
  return request({
    url: '/user/login',
    method: 'post',
    data: params
  })
}

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

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

