合入主线登录和营业时段策略,对齐旧界面与 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

+6
View File
@@ -1,6 +1,12 @@
'use strict';
const { fail } = require('../core/ledger');
const send = (res, status, data, contentType = 'application/json; charset=utf-8') => {
if (contentType.startsWith('text/html') && res.remainingBusinessTime) {
const remaining = Math.max(0, res.remainingBusinessTime());
data = data
.toString()
.replace('</body>', `<script src="/business-hours-lock.js" data-remaining="${remaining}"></script></body>`);
}
res.writeHead(status, { 'Content-Type': contentType });
res.end(contentType.startsWith('application/json') ? JSON.stringify(data) : data);
};