import request from '@/utils/request'

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

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

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

export function updatePass(data) {
  return request({
    url: '/user/upPass',
    method: 'put',
    params: {
      oldPass: data.oldPass,
      newPass: data.newPass
    }
  })
}

