mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	feat: 机器列表新增运行状态 & refactor: 登录账号信息存储与context
This commit is contained in:
		@@ -5,6 +5,7 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"mayfly-go/pkg/cache"
 | 
			
		||||
	"mayfly-go/pkg/config"
 | 
			
		||||
	"mayfly-go/pkg/contextx"
 | 
			
		||||
	"mayfly-go/pkg/errorx"
 | 
			
		||||
	"mayfly-go/pkg/model"
 | 
			
		||||
	"mayfly-go/pkg/rediscli"
 | 
			
		||||
@@ -60,12 +61,10 @@ func PermissionHandler(rc *Ctx) error {
 | 
			
		||||
			return errorx.PermissionErr
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if rc.LoginAccount == nil {
 | 
			
		||||
		rc.LoginAccount = &model.LoginAccount{
 | 
			
		||||
			Id:       userId,
 | 
			
		||||
			Username: userName,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	rc.MetaCtx = contextx.WithLoginAccount(rc.MetaCtx, &model.LoginAccount{
 | 
			
		||||
		Id:       userId,
 | 
			
		||||
		Username: userName,
 | 
			
		||||
	})
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user