This commit is contained in:
ct
2025-07-02 18:25:12 +08:00
parent 68a47ec916
commit 0aa0d9569f
20 changed files with 515 additions and 193 deletions

View File

@@ -0,0 +1,18 @@
import useUserStore from '@/stores/UserStore';
import { usePage } from '@inertiajs/react';
import { useEffect } from 'react';
const AuthUser = () => {
const { auth } = usePage().props;
const { user, fetchUser } = useUserStore();
useEffect(() => {
if (auth.user) {
if (user == null) {
fetchUser();
}
}
}, [auth.user]);
};
export default AuthUser;