import request from '@/utils/request'

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

export function loginOss(data) {
  return request({
    url: '/api/admin/auth/oss-login',
    method: 'post',
    data,
    noloading:true
  })
}

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

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 }
  })
}