feat(auth): 增加登录验证和五天会话

This commit is contained in:
admin committed 2026-09-21 17:46:43 +08:00
1 parent ecd16bcefc
commit 810b52a051
14 files changed
+467 -20

No files matched your search

+5 -1
View File
@@ -21,7 +21,11 @@
};
const send = base => fetch(makeUrl(base).toString(), {
method,
headers: { Accept: 'application/json', ...(body ? { 'Content-Type': 'application/json' } : {}) },
headers: {
Accept: 'application/json',
...(body ? { 'Content-Type': 'application/json' } : {}),
...(['POST', 'PUT', 'PATCH', 'DELETE'].includes(method) ? { 'X-CSRF-Token': global.document.querySelector('meta[name="csrf-token"]')?.content || '' } : {}),
},
...(body ? { body: JSON.stringify(body) } : {}),
});
let response = await send(BASE);