import request from '@/utils/request'
import qs from 'qs'

export function login (data) {
  return request({
    url: '/api-auth/usernameLogin',
    // url: '/user/login',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function getInfo () {
  return request({
    url: '/api-web/employee/queryUserInfo',
    method: 'get'
  })
}
// 登出
export function logout (data) {
  return request({
    url: '/api-auth/exit',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 获取首页数据
export function getIndex (data) {
  return request({
    url: '/api-web/index',
    method: 'get',
    params: data
  })
}
// 刷新token
export function getRefreshToken (data) {
  return request({
    url: '/api-auth/refreshToken',
    method: 'post',
    data: qs.stringify(data)
  })
}