如果您修改路由而不是依赖 api.onPageChange()(该函数似乎在页面渲染后才触发),可能会发现这个问题有所缓解。
api.onPageChange()
参见 Redirect an existing route in a theme component