mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-21 00:53:42 +08:00
feat(projects): 动态路由根路由重定向只需取决于后端返回的路由首页
ISSUES CLOSED: \
This commit is contained in:
@@ -31,6 +31,14 @@ export async function createDynamicRouteGuard(
|
||||
|
||||
if (to.name === routeName('not-found-page')) {
|
||||
// 动态路由没有加载导致被not-found-page路由捕获,等待权限路由加载好了,回到之前的路由
|
||||
|
||||
// 若路由是从根路由重定向过来的,重新回到根路由
|
||||
const ROOT_ROUTE_NAME: AuthRoute.RouteKey = 'root';
|
||||
if (to.redirectedFrom?.name === ROOT_ROUTE_NAME) {
|
||||
next({ path: '/', replace: true, query: to.query });
|
||||
return false;
|
||||
}
|
||||
|
||||
next({ path: to.fullPath, replace: true, query: to.query });
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user