一些微小的贡献

This commit is contained in:
KirinBaka
2025-04-22 15:19:28 +08:00
parent a04f1c22c9
commit bebf2c9640
7 changed files with 26 additions and 13 deletions

View File

@@ -4,13 +4,14 @@ import config from "@/config";
export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === "POST") {
if (req.headers.token !== config.token) {
console.log("wrong token", req.headers.token, config.token);
console.log("api::config: wrong token", req.headers.token, config.token);
res.status(403).json({ error: "wrong token" });
return;
}
// update config
config.begin = req.body.begin ?? config.begin;
config.limit = req.body.limit ?? config.limit;
console.log("api::config: update config", config);
}
res.status(200).json(config);
}