import request from '@/request/index.js'
import qs from 'qs'
export function postReq(url, data) {
  return request({
    method: 'post',
    url,
    data: {
      ...data,
      token: localStorage.getItem('token')
    }
  })
}

export function getReq(url, data) {
  const query = qs.stringify(
    {
      ...data,
      token: localStorage.getItem('token')
    },
    { indices: false }
  )
  return request({
    method: 'get',
    url: url + '?' + query
  })
}
