fix: add can_view_cloud_data to login and profile API responses
- Add can_view_cloud_data field to auth login response - Add can_view_cloud_data field to agent profile response - Fetch latest user permissions from /agent/profile on agent layout mount - Update localStorage with latest can_view_cloud_data value
This commit is contained in:
@@ -56,13 +56,14 @@ func (s *AuthService) Login(username, password, agentPath string) (map[string]in
|
||||
// 返回用户信息和令牌
|
||||
return map[string]interface{}{
|
||||
"user": map[string]interface{}{
|
||||
"id": user.ID,
|
||||
"username": user.Username,
|
||||
"email": user.Email,
|
||||
"avatar": user.Avatar,
|
||||
"role": user.Role,
|
||||
"status": user.Status,
|
||||
"parent_agent_id": user.ParentAgentID,
|
||||
"id": user.ID,
|
||||
"username": user.Username,
|
||||
"email": user.Email,
|
||||
"avatar": user.Avatar,
|
||||
"role": user.Role,
|
||||
"status": user.Status,
|
||||
"parent_agent_id": user.ParentAgentID,
|
||||
"can_view_cloud_data": user.CanViewCloudData,
|
||||
},
|
||||
"token": token,
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user