add qq oauth2 support / start landing page

This commit is contained in:
landaiqing
2024-08-19 23:11:22 +08:00
parent 8998259791
commit 498807ca66
28 changed files with 1123 additions and 129 deletions

View File

@@ -1,20 +1,10 @@
import {useAuthStore} from '@/store/modules/userStore.ts';
import {useThemeStore} from "@/store/modules/themeStore.ts";
import {langStore} from "@/store/modules/langStore.ts";
import {useAuthSessionStore} from "@/store/modules/userSessionStore.ts";
export default function useStore() {
// 是否自动登录 默认自动化登录
function isAutoLogin() {
const result: string | null = localStorage.getItem('auto_login');
if (result) {
return result === 'true';
}
return true;
}
return {
user: isAutoLogin() ? useAuthStore() : useAuthSessionStore(), // 自动登录时使用 useAuthStore否则使用 useAuthSessionStore
user: useAuthStore(),
theme: useThemeStore(),
lang: langStore(),
};