显示数量上限
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { authenticate, setLimit } from "../../../libs/db";
|
||||
import { authenticate, setLimit, getLimit } from "../../../libs/db";
|
||||
|
||||
export default function handler(req, res) {
|
||||
// put method
|
||||
@@ -24,6 +24,11 @@ export default function handler(req, res) {
|
||||
|
||||
setLimit(limitInt);
|
||||
res.status(200).send({ success: true });
|
||||
} else if (req.method === "GET") {
|
||||
res.setHeader("Cache-Control", "no-cache no-store must-revalidate");
|
||||
res.status(200).json({
|
||||
limit: getLimit(),
|
||||
});
|
||||
} else {
|
||||
res.status(405).send({ error: "方法" + req.method + "不被允许" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user