diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 60e7b636..a39482e1 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -145,8 +145,11 @@ const routes = [ }, { path: "/:catchAll(.*)*", - redirect: (to: RouteLocation) => - `/files/${[...to.params.catchAll].join("/")}`, + redirect: (to: RouteLocation) => { + const catchAll = to.params.catchAll; + if (!catchAll) return "/files/"; + return `/files/${Array.isArray(catchAll) ? catchAll.join("/") : catchAll}`; + }, }, ];