refactor(projects): new route guard

This commit is contained in:
Soybean
2024-03-25 02:42:50 +08:00
parent c11d56da29
commit 37d20b8e0d
12 changed files with 316 additions and 214 deletions

View File

@ -17,9 +17,7 @@ interface Props {
module?: UnionKey.LoginModule;
}
const props = withDefaults(defineProps<Props>(), {
module: 'pwd-login'
});
const props = defineProps<Props>();
const appStore = useAppStore();
const themeStore = useThemeStore();
@ -37,7 +35,7 @@ const moduleMap: Record<UnionKey.LoginModule, LoginModule> = {
'bind-wechat': { label: loginModuleRecord['bind-wechat'], component: BindWechat }
};
const activeModule = computed(() => moduleMap[props.module]);
const activeModule = computed(() => moduleMap[props.module || 'pwd-login']);
const bgThemeColor = computed(() =>
themeStore.darkMode ? getColorPalette(themeStore.themeColor, 7) : themeStore.themeColor