diff --git a/packages/app/src/router.jsx b/packages/app/src/router.jsx index 31b3df25..f09ce3f8 100755 --- a/packages/app/src/router.jsx +++ b/packages/app/src/router.jsx @@ -176,7 +176,14 @@ export const PageRender = React.memo((props) => { } app.backLocation = (state = {}) => { - return navigate(app.location.lastPathname, { + let to = app.location.lastPathname + + if (!to || to === app.location.pathname) { + console.warn("No last location found, redirecting to /") + to = "/" + } + + return navigate(to, { state }) }