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:
2026-05-11 00:15:21 +08:00
parent df4ad079f3
commit 6dcb5cde02
3 changed files with 37 additions and 14 deletions
+7 -6
View File
@@ -614,12 +614,13 @@ func handleGetProfile(c *gin.Context) {
}
response.Success(c, gin.H{
"id": user.ID,
"username": user.Username,
"email": user.Email,
"avatar": user.Avatar,
"balance": user.Balance,
"can_create_agent": user.CanCreateAgent,
"id": user.ID,
"username": user.Username,
"email": user.Email,
"avatar": user.Avatar,
"balance": user.Balance,
"can_create_agent": user.CanCreateAgent,
"can_view_cloud_data": user.CanViewCloudData,
})
}