我试图获取一个API,但它只在服务器端工作,所以我需要我的组件在服务器端,但我找到的所有获取url id的挂钩都是客户端的,有没有允许它的挂钩?
我已经尝试过useSearchParams、useRouter,但什么都没有,这是我正在尝试运行的组件。
import FerramentaCard from '@/components/ferramentas/ferramenta';
export default async function Ferramenta() {
const response = await fetch(`https://gameinfo.albiononline.com/api/gameinfo/items/${query.id}/data`, { method: 'GET', mode: 'no-cors' });
const ferramentaInfo = await response.json();
return <FerramentaCard ferramentaInfo={ferramentaInfo} />;
}