feat: 完善弹幕AI
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"use server";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export async function listLives(): Promise<any[]> {
|
||||
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 ?? [];
|
||||
}
|
||||
Reference in New Issue
Block a user