import Link from 'next/link' import { headers } from 'next/headers' async function fetchReports(baseUrl: string) { const url = `${baseUrl}/api/reports?limit=50` const resp = await fetch(url, { cache: 'no-store' }) if (!resp.ok) { return { items: [], total: 0 } } return resp.json() as Promise<{ items: Array<{ id: string; symbol: string; createdAt: string; content?: any }>; total: number }> } export default async function ReportsPage() { const h = await headers() const host = h.get('x-forwarded-host') || h.get('host') || 'localhost:3000' const proto = h.get('x-forwarded-proto') || 'http' const base = process.env.FRONTEND_INTERNAL_URL || process.env.NEXT_PUBLIC_BASE_URL || `${proto}://${host}` const { items, total } = await fetchReports(base) return (
暂无报告
) : (| 股票代码 | 公司名称 | 创建时间 | 操作 |
|---|---|---|---|
| {r.symbol} | {name || -} | {new Date(r.createdAt).toLocaleString()} | 查看 |