title: auto

des: auto
note:auto
This commit is contained in:
2023-10-03 11:00:16 +08:00
parent ab1bb590bf
commit fa46a3f055
7 changed files with 30 additions and 34 deletions

View File

@@ -6,8 +6,11 @@ import { NextResponse } from "next/server";
import { cookies } from "next/headers";
import { getConfig } from "@/bin/config";
export async function POST(req: Request) {
import fs from "fs";
import yaml from "yaml";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export async function POST(req: Request) {
if (req.method === "POST") {
const body = await req.json();
// MyConsole(body);
@@ -37,7 +40,7 @@ export async function POST(req: Request) {
username: data.username,
}),
{
password: (await getConfig()).server.password,
password: await config.server.password,
}
);