Files
Situation-Awareness-Platfor…/src/utils/hooks/useLoginCheck.ts

20 lines
425 B
TypeScript
Raw Normal View History

2025-03-12 18:41:20 +08:00
import { useAccountStore } from '@/stores/user';
import { emitEvent } from '@/utils/eventBus';
/**
*
* @returns
*/
export function useLoginCheck() {
const account = useAccountStore();
const loginCheck = (triggerType?: string) => {
if (!account.isLogin) {
emitEvent('login', { triggerType });
}
return account.isLogin;
};
return {
loginCheck
};
}