diff --git a/src/utils/marketplace.js b/src/utils/marketplace.js index 2e7ace5..1f50a3d 100644 --- a/src/utils/marketplace.js +++ b/src/utils/marketplace.js @@ -21,12 +21,13 @@ const httpPost = async (url, data) => { } -const httpGet = async (url) => { +const httpGet = async (url, data) => { const token = localStorage.getItem('assessToken'); let headers = {"Content-Type": "application/json"}; if (token) { headers['Authorization'] = `Bearer ${token}`; } + url = url + (url.indexOf('?') > -1 ? "&" : "?" )+ new URLSearchParams(data).toString() return fetch(url, { method: "GET", headers @@ -44,13 +45,13 @@ export const apiMarketplaceState = async (data) => { // 获取我拥有得资产 export const apiAssetsState = async (account_address, data) => { const url = `/api/asset/${net_id}/${account_address}` - return httpGet(url, {data}) + return httpGet(url, data) } // 获取上架出售得NFTS export const apiHangingState = async (account_address, data) => { const url = `/api/asset/${net_id}/${account_address}` - return httpGet(url, {data}) + return httpGet(url, data) } // 账号交易历史