Merge branch 'new-CounterFire' of http://git.kingsome.cn/huangjinming/CounterFireGames into new-CounterFire

This commit is contained in:
yuyongdong 2024-06-24 13:29:54 +08:00
commit 339e062b86

View File

@ -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
@ -43,14 +44,14 @@ export const apiMarketplaceState = async (data) => {
// 获取我拥有得资产
export const apiAssetsState = async (account_address, data) => {
const url = `${API_BASE}/api/asset/${net_id}/${account_address}?type=${data.type}?ge_size=${data.page_size}?cursor=${data.cursor}?search_name=${data.search_name}`
return httpGet(url, {})
const url = `/api/asset/${net_id}/${account_address}`
return httpGet(url, data)
}
// 获取上架出售得NFTS
export const apiHangingState = async (account_address, data) => {
const url = `${API_BASE}/api/asset/${net_id}/${account_address}`
return httpGet(url, {data})
const url = `/api/asset/${net_id}/${account_address}`
return httpGet(url, data)
}
// 账号交易历史
@ -74,7 +75,7 @@ export const apiGetCartList = async () => {
// 添加购物车
export const apiAddCartList = async (data) => {
const url = `${API_BASE}/api/shopcart/add`
return httpPost(url, {data})
return httpPost(url, data)
}
// 删除购物车