轻松聘
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
720 B

import { Redirect } from 'expo-router';
import { useAuth } from '../src/context/AuthContext';
import { useRole } from '../src/context/RoleContext';
/**
* 应用总入口(根路由 /)。
* 按「引导 → 登录 → 选择身份 → 对应端」漏斗放行,保证每个页面都有合理的前置入口。
*/
export default function Index() {
const { onboardingSeen, isLoggedIn } = useAuth();
const { role } = useRole();
if (!onboardingSeen) {
return <Redirect href="/guide" />;
}
if (!isLoggedIn) {
return <Redirect href="/login" />;
}
if (!role) {
return <Redirect href="/identity-select" />;
}
return <Redirect href={role === 'candidate' ? '/(tabs)' : '/(enterprise)'} />;
}