This commit is contained in:
2022-03-31 12:25:54 +08:00
parent 7e4c106683
commit a67715a2a0
7 changed files with 38 additions and 37 deletions

View File

@@ -8,7 +8,7 @@ export default function handler(req, res) {
// authenticate
if (!authenticate(token)) {
res.status(401).json({
error: "Unauthorized",
error: `token ${token} 验证失败`,
});
return;
}
@@ -17,7 +17,7 @@ export default function handler(req, res) {
const limitInt = parseInt(limit);
if (!limitInt) {
res.status(400).json({
error: "limit must be integer",
error: `数量限制必须是整数,但是传入了 ${limit}`,
});
return;
}
@@ -25,6 +25,6 @@ export default function handler(req, res) {
setLimit(limitInt);
res.status(200).send({ success: true });
} else {
res.status(405).send({ error: "method not allowed" });
res.status(405).send({ error: "方法" + req.method + "不被允许" });
}
}