fix(qdreader): use Beijing time for logs
This commit is contained in:
@@ -268,6 +268,19 @@ test('manual sign also archives immediately after run', () => {
|
||||
assert.deepEqual(JSON.parse(r.store.qdreader_last_result_json), {});
|
||||
});
|
||||
|
||||
test('logs and archive dates use Beijing time even when runtime date is UTC', () => {
|
||||
const store = {
|
||||
qdreader_cookie_json: JSON.stringify({ '12345': cookie }),
|
||||
qdreader_user_bind_json: JSON.stringify({ '12345': 'user-a' }),
|
||||
};
|
||||
const r = runPlugin({ content: '', store, userId: 'cron', globals: { Date: fixedDateClass('2026-05-18T23:30:00.000Z') } });
|
||||
assert.match(r.replies[0], /记录时间:2026-05-19 07:30:00/);
|
||||
assert.match(r.replies[0], /日志已归档:2026-05-19/);
|
||||
const archive = JSON.parse(r.store.qdreader_archive_json);
|
||||
assert.equal(archive['2026-05-19'].finishedAt, '2026-05-19 07:30:00');
|
||||
assert.equal(archive['2026-05-18'], undefined);
|
||||
});
|
||||
|
||||
test('query falls back to archived sign results after daily log was cleared', () => {
|
||||
const archiveRun = {
|
||||
source: 'cron',
|
||||
|
||||
Reference in New Issue
Block a user