security: 前端 WebSocket 连接传递 panel_token 认证
- dashboard.js / logs.js: WS URL 追加 ?token= 查询参数 - app.js: 添加 getCookie() 工具函数 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,8 @@ window.LogsModule = {
|
||||
}
|
||||
|
||||
var base = window.location.pathname.split("/").slice(0, 2).join("/");
|
||||
var ws = new WebSocket("ws://" + location.host + base + "/api/logs/ws");
|
||||
var tok = getCookie("panel_token");
|
||||
var ws = new WebSocket("ws://" + location.host + base + "/api/logs/ws?token=" + (tok || ""));
|
||||
self.ws = ws;
|
||||
|
||||
ws.onopen = function() {
|
||||
|
||||
Reference in New Issue
Block a user