import request from '@/utils/request'

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

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

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

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

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