import { getHeaders } from '@/H5Public/utils/2022new/getHeaders';

export default function requestJSON(url, data) {
  return fetch(url, {
    method: 'post',
    body: JSON.stringify({...data}),
    headers: {
      'Content-Type': 'application/json',
      Accept: 'application/json',
      ...getHeaders().headers,

    }
  })
    .then(function(res) {
      return res.json();
    }).then(function(data) {
      return data;
    })
}
