feat: update shortcut redirector

This commit is contained in:
Steven
2023-02-26 00:27:54 +08:00
parent 6b3ff5e462
commit 700598d1a5
10 changed files with 69 additions and 117 deletions

View File

@@ -62,21 +62,8 @@ const router = createBrowserRouter([
},
},
{
path: "/:workspaceName/go/:shortcutName",
path: "/:workspaceName/:shortcutName",
element: <ShortcutRedirector />,
loader: async () => {
try {
await userService.initialState();
await workspaceService.fetchWorkspaceList();
} catch (error) {
// do nth
}
const { user } = userService.getState();
if (isNullorUndefined(user)) {
return redirect("/user/auth");
}
},
},
]);