合入主线登录和营业时段策略,对齐旧界面与 React 访问流程

This commit is contained in:
黄健铭 committed 2026-12-05 21:46:55 -08:00
commit 42395de23a
113 files changed
+1915 -558

No files matched your search

+2 -1
View File
@@ -2,7 +2,7 @@
const { fail } = require('../../core/ledger');
const LIMIT = 300000;
// 按字节累计、超限即拒绝;收齐后一次性按 UTF-8 解码,避免多字节字符被块边界截断。
async function readBody(req) {
async function readBody(req, afterRead) {
const chunks = [];
let size = 0;
for await (const chunk of req) {
@@ -11,6 +11,7 @@ async function readBody(req) {
if (size > LIMIT) fail('内容过大', 413);
chunks.push(buffer);
}
afterRead?.();
const raw = Buffer.concat(chunks, size).toString('utf8');
try {
return JSON.parse(raw || '{}');