chore: Log 组件的 fetch 默认加上 cookie Closes #3639 (#3648)

This commit is contained in:
吴多益 2022-02-28 11:59:56 +08:00 committed by GitHub
parent dd3adba4f9
commit 5428874d30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,7 +134,8 @@ export class Log extends React.Component<LogProps, LogState> {
const res = await fetch(api.url, {
method: api.method?.toLocaleUpperCase() || 'GET',
headers: (api.headers as Record<string, string>) || undefined,
body: api.data ? JSON.stringify(api.data) : undefined
body: api.data ? JSON.stringify(api.data) : undefined,
credentials: 'include'
});
if (res.status === 200) {
const body = res.body;