2 lines
866 B
JavaScript
2 lines
866 B
JavaScript
import{J as e}from"./index-DGJ6dnLh.js";const s="https://ra3.z31.xyz/v1",c=async(r={})=>{try{return(await e.get(`${s}/maps/`,{params:{p:r.page||1,search:r.search||"",player_count:r.player_count||"",tags:r.tags||"",ordering:r.ordering||""}})).data}catch(t){throw console.error("获取地图列表失败:",t),t}},p=async(r={})=>{try{return(await e.get(`${s}/maps/`,{params:{p:r.page||1,format:"json",ordering:r.ordering||""}})).data.results}catch(t){throw console.error("获取地图列表失败:",t),t}},g=async r=>{try{return(await e.get(`${s}/maps/${r}/`)).data}catch(t){throw console.error("获取地图详情失败:",t),t}},h=async()=>{try{const r=await e.get(`${s}/maps/`),t=new Set;return r.data.results.forEach(o=>{o.tags.forEach(a=>t.add(a))}),Array.from(t)}catch(r){throw console.error("获取标签列表失败:",r),r}};export{c as a,p as b,g as c,h as g};
|