修复monitor问题

This commit is contained in:
junleea 2024-11-24 15:19:37 +08:00
parent f15a1d605b
commit b2053f14e4
1 changed files with 3 additions and 3 deletions

View File

@ -47,12 +47,12 @@ func SetDeviceStatusV2(c *gin.Context) {
c.JSON(200, gin.H{"code": 400, "message": "参数错误"})
return
} else {
token, _ := c.Get("token")
if token == nil {
token := c.Request.Header.Get("token")
if token == "" {
c.JSON(200, gin.H{"code": 401, "message": "token为空"})
return
}
devices := worker.GetRedisSetMembers(token.(string))
devices := worker.GetRedisSetMembers(token)
if len(devices) == 0 {
c.JSON(200, gin.H{"code": 402, "message": "设备为空"})
return