fix(platform): harden auth and build integration
This commit is contained in:
@@ -99,7 +99,9 @@ export function useProjectionStream(opts: ProjectionStreamOptions = {}) {
|
||||
|
||||
if (es) return
|
||||
try {
|
||||
es = new EventSource(url)
|
||||
// withCredentials:让浏览器把 httpOnly 鉴权 Cookie (simple.auth.token) 随 SSE 一起带上,
|
||||
// 配合后端给 /api/sl/* 反代加的鉴权(EventSource 无法设置 Authorization header,只能靠 Cookie)。
|
||||
es = new EventSource(url, { withCredentials: true })
|
||||
} catch {
|
||||
scheduleReconnect()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user