build(projects): update tsconfig、eslintrc

This commit is contained in:
Soybean
2022-03-12 16:21:40 +08:00
parent 4093dcd6dc
commit 75de2b0604
131 changed files with 1174 additions and 1140 deletions

View File

@@ -13,7 +13,7 @@ export function createRouterGuard(router: Router) {
// 页面跳转权限处理
await createPermissionGuard(to, from, next, router);
});
router.afterEach(to => {
router.afterEach((to) => {
// 设置document title
useTitle(to.meta.title);
// 结束 loadingBar

View File

@@ -34,14 +34,14 @@ export async function createPermissionGuard(
isLogin && to.name === routeName('login'),
() => {
next({ name: routeName('root') });
}
},
],
// 不需要登录权限的页面直接通行
[
!needLogin,
() => {
next();
}
},
],
// 未登录状态进入需要登录权限的页面
[
@@ -49,22 +49,22 @@ export async function createPermissionGuard(
() => {
const redirect = to.fullPath;
next({ name: routeName('login'), query: { redirect } });
}
},
],
// 登录状态进入需要登录权限的页面,有权限直接通行
[
isLogin && needLogin && hasPermission,
() => {
next();
}
},
],
[
// 登录状态进入需要登录权限的页面,无权限,重定向到无权限页面
isLogin && needLogin && !hasPermission,
() => {
next({ name: routeName('no-permission') });
}
]
},
],
];
exeStrategyActions(actions);