This commit is contained in:
2026-08-31 14:42:22 +08:00
72 changed files with 2479 additions and 168 deletions
+3 -1
View File
@@ -40,7 +40,9 @@ namespace IM.Jwt
{
var accessToken = context.Request.Query["access_token"];
var path = context.HttpContext.Request.Path;
if (!string.IsNullOrEmpty(accessToken) && path.StartsWithSegments("/hub")) // 假设你的 SignalR 路径是 /hub
// SignalR WebSocket 握手时 token 通过 query string 传递(不是 Authorization 头)
// Hub 路径为 /chat(见 ConnectorService/Program.cs
if (!string.IsNullOrEmpty(accessToken) && path.StartsWithSegments("/chat"))
{
context.Token = accessToken;
}