mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(components): 修复BaseLayout的HorizontalLayout
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import type { CustomRoute } from '@/interface';
|
||||
import { BasicLayout } from '@/layouts';
|
||||
import { BaseLayout } from '@/layouts';
|
||||
import { setRouterCacheName } from '@/utils';
|
||||
import DashboardWorkbench from '@/views/dashboard/workbench/index.vue';
|
||||
import { ROUTE_HOME } from '../routes';
|
||||
@ -10,7 +10,7 @@ setRouterCacheName(DashboardWorkbench, routeName('dashboard_workbench'));
|
||||
const DASHBOARD: CustomRoute = {
|
||||
name: routeName('dashboard'),
|
||||
path: routePath('dashboard'),
|
||||
component: BasicLayout,
|
||||
component: BaseLayout,
|
||||
redirect: { name: routeName('dashboard_analysis') },
|
||||
meta: {
|
||||
title: routeTitle('dashboard_analysis'),
|
||||
|
@ -22,12 +22,14 @@ export default function createRouterGuide(router: Router) {
|
||||
});
|
||||
}
|
||||
|
||||
type RouterAction = [boolean, () => void];
|
||||
|
||||
function handleRouterAction(to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) {
|
||||
const token = getToken();
|
||||
const isLogin = Boolean(token);
|
||||
const needLogin = Boolean(to.meta?.requiresAuth);
|
||||
|
||||
const routerAction: [boolean, () => void][] = [
|
||||
const routerAction: RouterAction[] = [
|
||||
// 已登录状态跳转登录页,跳转至首页
|
||||
[
|
||||
isLogin && to.name === routeName('login'),
|
||||
@ -60,9 +62,9 @@ function handleRouterAction(to: RouteLocationNormalized, from: RouteLocationNorm
|
||||
];
|
||||
|
||||
routerAction.some(item => {
|
||||
const flag = item[0];
|
||||
const [flag, callback] = item;
|
||||
if (flag) {
|
||||
item[1]();
|
||||
callback();
|
||||
}
|
||||
return flag;
|
||||
});
|
||||
|
Reference in New Issue
Block a user