This commit is contained in:
oneao committed 2025-11-14 21:58:28 +08:00
1 parent 737aa98d18
commit 3bbccd616d
95 files changed
+858 -22766

No files matched your search

+14 -5
View File
@@ -17,6 +17,10 @@ import 'react-native-gesture-handler'
SplashScreen.preventAutoHideAsync()
export const unstable_settings = {
initialRouteName: 'money', // 指向你想默认显示的页面
}
export function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {
return (
<GluestackUIProvider>
@@ -44,14 +48,19 @@ export default function RootLayout() {
useEffect(() => {
if (fontsLoaded) {
SplashScreen.hideAsync()
// 如果没有 token,则跳转登录页
if (!userStore.isLoggedIn()) {
router.replace('/auth')
}
}
}, [fontsLoaded])
if (!fontsLoaded) {
// 字体未加载,显示空白或 Splash
return null
}
if (!userStore.isLoggedIn()) {
// 未登录直接跳到 auth
router.replace('/auth')
return null
}
return (
<KeyboardProvider>
<GluestackUIProvider>