Refactor route protection by replacing ProtectedRoute with ClientRouteGuard in analytics, create-shorturl, and links pages to standardize authentication handling across the application.

This commit is contained in:
2025-04-24 01:41:44 +08:00
parent d80d5e976b
commit 3162836e91
4 changed files with 67 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ import { ProjectSelector } from '@/app/components/ui/ProjectSelector';
import { TagSelector } from '@/app/components/ui/TagSelector';
import { useSearchParams } from 'next/navigation';
import { useShortUrlStore } from '@/app/utils/store';
import ClientRouteGuard from '@/app/components/ClientRouteGuard';
// 事件类型定义
interface Event {
@@ -1109,12 +1110,14 @@ function AnalyticsContent() {
// Main page component with Suspense
export default function AnalyticsPage() {
return (
<Suspense fallback={
<div className="flex items-center justify-center min-h-screen">
<div className="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500" />
</div>
}>
<AnalyticsContent />
</Suspense>
<ClientRouteGuard>
<Suspense fallback={
<div className="flex items-center justify-center min-h-screen">
<div className="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500" />
</div>
}>
<AnalyticsContent />
</Suspense>
</ClientRouteGuard>
);
}