"use server"; import { cookies } from "next/headers"; export async function listLives(): Promise { const token = cookies().get("token"); const params = new URLSearchParams(); params.append("pageSize", "99999"); const lives = await fetch( "https://tachy.daoyoucloud.com/api/lives:list?" + params.toString(), { method: "GET", headers: { "X-App": "danmu-sim", "X-Authenticator": "basic", authorization: "Bearer " + token?.value, "content-type": "application/json", }, next: { tags: ["lives"], }, } ); const result = await lives.json(); return result?.data ?? []; }