✨ add qq oauth2 support / start landing page
This commit is contained in:
@@ -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(),
|
||||
};
|
||||
|
Reference in New Issue
Block a user