fix: fetchJSON 去除最后一个结尾的&

feature/price_manager
Lei OT 1 year ago
parent 2aa20577d5
commit d3b53b766b

@ -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,

Loading…
Cancel
Save