feat(projects): 迁移登录完成

This commit is contained in:
Soybean
2022-01-05 01:35:32 +08:00
parent f5a36a05cb
commit b93b80cb4b
54 changed files with 1679 additions and 260 deletions

View File

@ -40,12 +40,18 @@ export function transformAuthRouteToVueRoute(item: AuthRoute.Route) {
consoleError('路由组件解析失败: ', item);
}
}
if (hasProps(item) && !isSingleRoute(item)) {
(itemRoute as any).props = item.props;
}
if (isSingleRoute(item)) {
itemRoute.children = [
{
path: '',
name: item.name,
component: getViewComponent(item.name)
component: getViewComponent(item.name),
props: hasProps(item) ? item.props : undefined
}
];
} else if (hasChildren(item)) {
@ -67,6 +73,10 @@ function hasChildren(item: AuthRoute.Route) {
return Boolean(item.children && item.children.length);
}
function hasProps(item: AuthRoute.Route) {
return Boolean(item.props);
}
function isSingleRoute(item: AuthRoute.Route) {
return Boolean(item.meta.single);
}