diff --git a/src/utils/request.js b/src/utils/request.js index f536a02..461bfed 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -49,8 +49,9 @@ export function fetchText(url) { export function fetchJSON(url, data) { const params = data ? new URLSearchParams(data).toString() : ''; const ifp = url.includes('?') ? '&' : '?'; - const headerObj = getRequestHeader() - return fetch(`${url}${ifp}${params}`, { + const headerObj = getRequestHeader(); + const fUrl = params !== '' ? `${fUrl}${ifp}${params}` : url; + return fetch(fUrl, { method: 'GET', headers: { 'X-Web-Version': BUILD_VERSION,