diff --git a/src/router/index.js b/src/router/index.js index 686da2dde..dfe066345 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -71,6 +71,10 @@ export default route(function (/* { store, ssrContext } */) { } } + if (to.params.id && !/^\d+$/.test(to.params.id)) { + return next(to.matched[1]?.children[0]?.redirect); + } + next(); });