import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/api/admin/auth/login',
    method: 'post',
    data,
    isLoading: false
  })
}

export function getInfo(token) {
  return request({
    url: '/api/admin/auth/me',
    method: 'post',
    params: { token },
    isLoading: false,
  })
}

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

export function getAuthMenu(token) {
  return request({
    url: '/api/admin/auth/permissions',
    method: 'get',
    params: { token },
    isLoading: false
  })
}
