详情页时间字段改北京时间 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
+3 -1
View File
@@ -81,7 +81,9 @@ const sleep = (ms) => new Promise(r => setTimeout(r, ms));
console.log('== 5. 候选人详情弹窗 ==');
await p.evaluate(() => document.querySelector('#tbody tr')?.click()); await sleep(800);
ok('弹窗打开且含简历全文', (await $('#detailBody').innerText()).includes('简历全文'));
const detText = await $('#detailBody').innerText();
ok('弹窗打开且含简历全文', detText.includes('简历全文'));
ok('时间格式为 Y-m-d H:i:s', /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(detText));
await p.screenshot({ path: '/tmp/smoke-shots/03-detail.png' });
await p.evaluate(() => document.getElementById('detailModal').classList.add('hidden'));
+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);
});