async function getData() { const response = await request.get("/protocol/legal", {status: 2}); if (response.code !== 0) { throw new Error('Failed to fetch data') } return response.data.content; }
const Legal = async () => { const content = await getData();
return(<div>....</div>)
}
打包报错信息如下: Error occurred prerendering page "/protocol/legal". Read more: https://nextjs.org/docs/messages/prerender-error