refactor(projects): remove enum

This commit is contained in:
Soybean
2023-02-23 08:38:03 +08:00
parent 44b544745d
commit 21d5214247
31 changed files with 323 additions and 240 deletions

View File

@ -9,13 +9,13 @@ interface ModuleComponent {
default: RouteComponent;
}
type LayoutComponent = Record<EnumType.LayoutComponentName, Lazy<ModuleComponent>>;
type LayoutComponent = Record<UnionKey.LayoutComponentName, Lazy<ModuleComponent>>;
/**
* 获取布局的vue文件(懒加载的方式)
* @param layoutType - 布局类型
*/
export function getLayoutComponent(layoutType: EnumType.LayoutComponentName) {
export function getLayoutComponent(layoutType: UnionKey.LayoutComponentName) {
const layoutComponent: LayoutComponent = {
basic: BasicLayout,
blank: BlankLayout

View File

@ -1,5 +1,5 @@
/** 获取登录页面模块的动态路由的正则 */
export function getLoginModuleRegExp() {
const modules: EnumType.LoginModuleKey[] = ['pwd-login', 'code-login', 'register', 'reset-pwd', 'bind-wechat'];
const modules: UnionKey.LoginModule[] = ['pwd-login', 'code-login', 'register', 'reset-pwd', 'bind-wechat'];
return modules.join('|');
}