fix build
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import React, { useState, useEffect, Suspense } from 'react';
|
||||||
import { format, subDays } from 'date-fns';
|
import { format, subDays } from 'date-fns';
|
||||||
import { DateRangePicker } from '@/app/components/ui/DateRangePicker';
|
import { DateRangePicker } from '@/app/components/ui/DateRangePicker';
|
||||||
import TimeSeriesChart from '@/app/components/charts/TimeSeriesChart';
|
import TimeSeriesChart from '@/app/components/charts/TimeSeriesChart';
|
||||||
@@ -11,9 +11,8 @@ import { EventsSummary, TimeSeriesData, GeoData, DeviceAnalytics as DeviceAnalyt
|
|||||||
import { TeamSelector } from '@/app/components/ui/TeamSelector';
|
import { TeamSelector } from '@/app/components/ui/TeamSelector';
|
||||||
import { ProjectSelector } from '@/app/components/ui/ProjectSelector';
|
import { ProjectSelector } from '@/app/components/ui/ProjectSelector';
|
||||||
import { TagSelector } from '@/app/components/ui/TagSelector';
|
import { TagSelector } from '@/app/components/ui/TagSelector';
|
||||||
import { useSearchParams } from 'next/navigation';
|
import { useSearchParams, useRouter } from 'next/navigation';
|
||||||
import { useShortUrlStore } from '@/app/utils/store';
|
import { useShortUrlStore } from '@/app/utils/store';
|
||||||
import { useRouter } from 'next/navigation';
|
|
||||||
|
|
||||||
// 事件类型定义
|
// 事件类型定义
|
||||||
interface Event {
|
interface Event {
|
||||||
@@ -116,7 +115,8 @@ const extractEventInfo = (event: Event) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AnalyticsPage() {
|
// Analytics Content Component that uses URL parameters
|
||||||
|
function AnalyticsContent() {
|
||||||
// 从 URL 获取查询参数
|
// 从 URL 获取查询参数
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -834,6 +834,7 @@ export default function AnalyticsPage() {
|
|||||||
teamIds={selectedTeamIds}
|
teamIds={selectedTeamIds}
|
||||||
projectIds={selectedProjectIds}
|
projectIds={selectedProjectIds}
|
||||||
tagIds={selectedTagNames}
|
tagIds={selectedTagNames}
|
||||||
|
linkId={selectedShortUrl?.externalId}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1190,4 +1191,17 @@ export default function AnalyticsPage() {
|
|||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,19 @@ export async function GET(request: NextRequest) {
|
|||||||
// 获取UTM类型参数
|
// 获取UTM类型参数
|
||||||
const utmType = searchParams.get('utmType') || 'source';
|
const utmType = searchParams.get('utmType') || 'source';
|
||||||
|
|
||||||
|
// 添加调试日志
|
||||||
|
console.log('UTM API received parameters:', {
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
linkId,
|
||||||
|
teamIds,
|
||||||
|
projectIds,
|
||||||
|
tagIds,
|
||||||
|
tagNames,
|
||||||
|
utmType,
|
||||||
|
url: request.url
|
||||||
|
});
|
||||||
|
|
||||||
// 构建WHERE子句
|
// 构建WHERE子句
|
||||||
let whereClause = '';
|
let whereClause = '';
|
||||||
const conditions = [];
|
const conditions = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user