|
|
@ -49,8 +49,9 @@ export function fetchText(url) {
|
|
|
|
export function fetchJSON(url, data) {
|
|
|
|
export function fetchJSON(url, data) {
|
|
|
|
const params = data ? new URLSearchParams(data).toString() : '';
|
|
|
|
const params = data ? new URLSearchParams(data).toString() : '';
|
|
|
|
const ifp = url.includes('?') ? '&' : '?';
|
|
|
|
const ifp = url.includes('?') ? '&' : '?';
|
|
|
|
const headerObj = getRequestHeader()
|
|
|
|
const headerObj = getRequestHeader();
|
|
|
|
return fetch(`${url}${ifp}${params}`, {
|
|
|
|
const fUrl = params !== '' ? `${fUrl}${ifp}${params}` : url;
|
|
|
|
|
|
|
|
return fetch(fUrl, {
|
|
|
|
method: 'GET',
|
|
|
|
method: 'GET',
|
|
|
|
headers: {
|
|
|
|
headers: {
|
|
|
|
'X-Web-Version': BUILD_VERSION,
|
|
|
|
'X-Web-Version': BUILD_VERSION,
|
|
|
|