Skip to content

Commit

Permalink
fix: sse post no token
Browse files Browse the repository at this point in the history
  • Loading branch information
AkaraChen committed Nov 12, 2024
1 parent a37e41d commit e175ad9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/service/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,15 @@ export const ssePost = (
} = otherOptions
const abortController = new AbortController()

const token = localStorage.getItem('console_token')

const options = Object.assign({}, baseOptions, {
method: 'POST',
signal: abortController.signal,
}, fetchOptions)
headers: new Headers({
Authorization: `Bearer ${token}`,
}),
} as RequestInit, fetchOptions)

const contentType = (options.headers as Headers).get('Content-Type')
if (!contentType)
Expand Down

0 comments on commit e175ad9

Please sign in to comment.