fix: server 审查修复——member_id 校验、访问日志 finally、静默初始化并发

非法 member_id 不再以 NaN 入库;HTTP 访问日志覆盖异常路径;setup-state 静默建管理员遇唯一冲突视为已初始化。
This commit is contained in:
2026-10-06 12:55:18 +08:00
parent fa5b3a8942
commit 54ea686f44
4 changed files with 41 additions and 17 deletions
+5 -2
View File
@@ -40,8 +40,11 @@ export function createApp(opts: CreateAppOptions) {
app.use("*", async (c, next) => {
const start = Date.now();
await next();
appLogger("http").info`${c.req.method} ${c.req.path} → ${c.res.status} · ${Date.now() - start}ms`;
try {
await next();
} finally {
appLogger("http").info`${c.req.method} ${c.req.path} → ${c.res.status} · ${Date.now() - start}ms`;
}
});
app.use("*", async (c, next) => {
c.set("repos", repos);