import request from '@/utils/request'
function urlencoded(data) {
  const newData = Object.keys(data).map((key) => {
    return `${key}=${encodeURIComponent(data[key])}`
  }).join('&')
  return newData
}

export function getAuthMenu(data) {
  return request({
    url: '/aiccs-api/tUsermenu/getUserRights',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: urlencoded(data)
  })
}

export function getUserMenus(data) {
  return request({
    url: '/aiccs-api/tUsermenu/getUserMenus',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: urlencoded(data)
  })
}
