mirror of
				https://github.com/soybeanjs/soybean-admin.git
				synced 2025-11-04 15:53:43 +08:00 
			
		
		
		
	fix(projects): 修复路由守卫的动态路由逻辑
This commit is contained in:
		
							
								
								
									
										3
									
								
								components.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								components.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -16,6 +16,9 @@ declare module 'vue' {
 | 
				
			|||||||
    IconCustomAvatar: typeof import('~icons/custom/avatar')['default']
 | 
					    IconCustomAvatar: typeof import('~icons/custom/avatar')['default']
 | 
				
			||||||
    IconCustomLogo: typeof import('~icons/custom/logo')['default']
 | 
					    IconCustomLogo: typeof import('~icons/custom/logo')['default']
 | 
				
			||||||
    IconCustomLogoFill: typeof import('~icons/custom/logo-fill')['default']
 | 
					    IconCustomLogoFill: typeof import('~icons/custom/logo-fill')['default']
 | 
				
			||||||
 | 
					    IconCustomNoPermission: typeof import('~icons/custom/no-permission')['default']
 | 
				
			||||||
 | 
					    IconCustomNotFound: typeof import('~icons/custom/not-found')['default']
 | 
				
			||||||
 | 
					    IconCustomServiceError: typeof import('~icons/custom/service-error')['default']
 | 
				
			||||||
    IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
 | 
					    IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
 | 
				
			||||||
    IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']
 | 
					    IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']
 | 
				
			||||||
    IconIcOutlineCheck: typeof import('~icons/ic/outline-check')['default']
 | 
					    IconIcOutlineCheck: typeof import('~icons/ic/outline-check')['default']
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,11 +35,12 @@ export async function createDynamicRouteGuard(
 | 
				
			|||||||
      next({ path: to.fullPath, replace: true, query: to.query });
 | 
					      next({ path: to.fullPath, replace: true, query: to.query });
 | 
				
			||||||
      return false;
 | 
					      return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // 动态路由已经加载,仍然未找到,重定向到not-found
 | 
					  }
 | 
				
			||||||
    if (to.name === routeName('not-found-page')) {
 | 
					
 | 
				
			||||||
      next({ name: routeName('not-found'), replace: true });
 | 
					  // 动态路由已经加载,仍然未找到,重定向到not-found
 | 
				
			||||||
      return false;
 | 
					  if (to.name === routeName('not-found-page')) {
 | 
				
			||||||
    }
 | 
					    next({ name: routeName('not-found'), replace: true });
 | 
				
			||||||
 | 
					    return false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return true;
 | 
					  return true;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,9 @@ export default function subscribeThemeStore() {
 | 
				
			|||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        removeDarkClass();
 | 
					        removeDarkClass();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      immediate: true,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user