common get post method, and control, edit page

This commit is contained in:
2023-02-04 01:04:16 +08:00
parent e77173a8af
commit 849aecac6b
12 changed files with 175 additions and 537 deletions

View File

@@ -1,12 +1,10 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from "next";
import store from "@/store";
import { store as storeProxy } from "@/store";
import config from "@/config";
export default function handler(
req: NextApiRequest,
res: NextApiResponse,
) {
export default function handler(req: NextApiRequest, res: NextApiResponse) {
const store = storeProxy.get();
if (req.method === "POST") {
if (!config.begin) {
res.status(400).json({