mirror of
https://github.com/KingHWJ/WeReadBoard.git
synced 2026-11-03 18:24:58 +08:00
feat(auth): 增加登录验证和五天会话
This commit is contained in:
1 parent
ecd16bcefc
commit
810b52a051
14 files changed
+467
-20
No files matched your search
+5
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user