fix: sse post no token
This commit is contained in:
parent
a37e41de99
commit
e175ad9963
@ -326,10 +326,15 @@ export const ssePost = (
|
|||||||
} = otherOptions
|
} = otherOptions
|
||||||
const abortController = new AbortController()
|
const abortController = new AbortController()
|
||||||
|
|
||||||
|
const token = localStorage.getItem('console_token')
|
||||||
|
|
||||||
const options = Object.assign({}, baseOptions, {
|
const options = Object.assign({}, baseOptions, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
signal: abortController.signal,
|
signal: abortController.signal,
|
||||||
}, fetchOptions)
|
headers: new Headers({
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
}),
|
||||||
|
} as RequestInit, fetchOptions)
|
||||||
|
|
||||||
const contentType = (options.headers as Headers).get('Content-Type')
|
const contentType = (options.headers as Headers).get('Content-Type')
|
||||||
if (!contentType)
|
if (!contentType)
|
||||||
|
Loading…
Reference in New Issue
Block a user