Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/app/src/middleware/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export async function middleware(
// return NextResponse.redirect(loginUrl);
// }
if (url.pathname === '/') {
return NextResponse.redirect(new URL('/welcome', request.url));
// return NextResponse.redirect(new URL('/welcome', request.url));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议添加注释说明为什么使用 rewrite 而不是 redirect,以便其他开发者理解这个设计决策

Suggested change
// return NextResponse.redirect(new URL('/welcome', request.url));
// 使用 rewrite 而不是 redirect 以保持 URL 不变,提供更好的用户体验
return NextResponse.rewrite(new URL('/welcome', request.url));

return NextResponse.rewrite(new URL('/welcome', request.url));
}

// 页面上报
Expand Down