| | |
| | | permissionStore.getAddRouters.forEach((route) => { |
| | | router.addRoute(route as unknown as RouteRecordRaw) // 动态添加可访问路由表 |
| | | }) |
| | | const redirectPath = from.query.redirect || to.path |
| | | // 修复跳转时不带参数的问题 |
| | | const redirect = decodeURIComponent(redirectPath as string) |
| | | const { paramsObject: query } = parseURL(redirect) |
| | | const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect, query } |
| | | next(nextData) |
| | | |
| | | // 新增【诊室选择】逻辑 |
| | | if (userStore.getRoles.includes("doctor") && !userStore.getIsSetRoom ) { |
| | | next({path: "/login-room-select"}) |
| | | } |
| | | // <<<【诊室选择】<<< |
| | | else { |
| | | const redirectPath = from.query.redirect || to.path |
| | | // 修复跳转时不带参数的问题 |
| | | const redirect = decodeURIComponent(redirectPath as string) |
| | | const {paramsObject: query} = parseURL(redirect) |
| | | const nextData = to.path === redirect ? {...to, replace: true} : {path: redirect, query} |
| | | next(nextData) |
| | | } |
| | | } else { |
| | | next() |
| | | } |