mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	feature: 每个客户端独立处理后端发送的系统消息
This commit is contained in:
		@@ -81,7 +81,12 @@ func (a *Account) ChangePassword(rc *req.Ctx) {
 | 
			
		||||
	a.AccountApp.Update(updateAccount)
 | 
			
		||||
 | 
			
		||||
	// 赋值loginAccount 主要用于记录操作日志,因为操作日志保存请求上下文没有该信息不保存日志
 | 
			
		||||
	rc.LoginAccount = &model.LoginAccount{Id: account.Id, Username: account.Username}
 | 
			
		||||
	if rc.LoginAccount == nil {
 | 
			
		||||
		rc.LoginAccount = &model.LoginAccount{
 | 
			
		||||
			Id:       account.Id,
 | 
			
		||||
			Username: account.Username,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取个人账号信息
 | 
			
		||||
 
 | 
			
		||||
@@ -37,5 +37,7 @@ func (s *System) ConnectWs(g *gin.Context) {
 | 
			
		||||
 | 
			
		||||
	// 登录账号信息
 | 
			
		||||
	la := rc.LoginAccount
 | 
			
		||||
	ws.AddClient(la.Id, wsConn)
 | 
			
		||||
	if la != nil {
 | 
			
		||||
		ws.AddClient(la.Id, la.ClientUuid, wsConn)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user