是否有可能在getServerSideProps函数中以类似于next.config.js的方式使用重定向发送数据(据我所知,您不能在下一个配置文件中传递隐藏的查询)。
export const getServerSideProps = async (context) => {
const id = context.params.id;
return {
redirect: {
destination: '/my-work',
permanent: false,
has: [
{
type: 'query',
value: id
}
]
},
props: {
}
}
}
我想通过隐藏查询到另一个页面,所以这只作为中间件重定向工作,因为我是从电子邮件模板进入这个页面。但有对象是不工作的getServerSideProps功能。
有没有其他方法可以做到这一点?
谢谢你的帮助!
1条答案
按热度按时间o3imoua41#
这是官方文件。
}、}
您可以将参数与它进行比较。有关详细信息,请访问here