使用 nextjs,我有包含用户 JWT 的状态,这需要传递到 getServerSideProps 中的请求中。
export async function getServerSideProps(ctx) {
const res = await fetch('http://localhost:1337/publics')
const data = await res.json()
const theData = data[ctx.query.id - 1]
return {
props: {data: theData},
}
}
我如何在这里传递 JWT?