生产管理系统 - 登录页面,注册页面改成nextjs router 跳转
This commit is contained in:
@@ -21,8 +21,8 @@ export function ClientAuthInterceptor({ children }: ClientAuthInterceptorProps)
|
||||
|
||||
const currentPath = window.location.pathname;
|
||||
|
||||
// 如果已经在认证页面(包括 /login 开头的所有路径),不需要重定向
|
||||
if (currentPath.startsWith('/login')) {
|
||||
// 如果已经在认证页面(包括 /login 开头的所有路径、/register 和根路径),不需要重定向
|
||||
if (currentPath.startsWith('/login') || currentPath === '/register' || currentPath === '/') {
|
||||
console.log(`📄 已在认证页面,跳过拦截: ${currentPath}`);
|
||||
return;
|
||||
}
|
||||
@@ -47,8 +47,8 @@ export function ClientAuthInterceptor({ children }: ClientAuthInterceptorProps)
|
||||
return <LoadingScreen variant="auth" />;
|
||||
}
|
||||
|
||||
// 如果在认证页面(包括 /login 开头的所有路径),直接渲染子组件,不需要认证检查
|
||||
if (currentPath.startsWith('/login')) {
|
||||
// 如果在认证页面(包括 /login 开头的所有路径、/register 和根路径),直接渲染子组件,不需要认证检查
|
||||
if (currentPath.startsWith('/login') || currentPath === '/register' || currentPath === '/') {
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user