详情页时间字段改北京时间 Y-m-d H:i:s 格式(抓取/更新/打招呼时间)

This commit is contained in:
mzl92
2026-08-27 16:04:46 +08:00
parent 022546f8d3
commit affb22a637
2 changed files with 7 additions and 1 deletions
+4
View File
@@ -197,6 +197,10 @@ app.get('/api/candidates/:id', requireAuth, (req, res) => {
raw_text, education_detail, work_detail, cert_detail, score_details, notes, scraped_at, updated_at
FROM candidates WHERE id = ?`).get(req.params.id);
if (!row) return res.status(404).json({ error: '不存在' });
const bj = (s) => s ? new Date(new Date(s).getTime() + 8 * 3600e3).toISOString().slice(0, 19).replace('T', ' ') : s;
row.scraped_at = bj(row.scraped_at);
row.updated_at = bj(row.updated_at);
if (row.greeted_at) row.greeted_at = bj(row.greeted_at);
res.json(row);
});