refactor: websocket支持单用户多连接

This commit is contained in:
meilin.huang
2023-10-19 19:00:23 +08:00
parent 747ea6404d
commit 2b91bbe185
31 changed files with 365 additions and 263 deletions

View File

@@ -60,16 +60,10 @@ func PermissionHandler(rc *Ctx) error {
return biz.PermissionErr
}
}
clientUuid := rc.GinCtx.Request.Header.Get("Client-Uuid")
// header不存在则从查询参数token中获取
if clientUuid == "" {
clientUuid = rc.GinCtx.Query("clientUuid")
}
if rc.LoginAccount == nil {
rc.LoginAccount = &model.LoginAccount{
Id: userId,
Username: userName,
ClientUuid: clientUuid,
Id: userId,
Username: userName,
}
}
return nil