Compare commits

..

No commits in common. "28edd048edeb10a5a7b0a3cac550b78c25486c7a" and "35823bee30fcecaa02e587ce733e63ef721b7b42" have entirely different histories.

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": "参数错误"}) c.JSON(200, gin.H{"code": 400, "message": "参数错误"})
return return
} else { } else {
token := c.Request.Header.Get("token") token, _ := c.Get("token")
if token == "" { if token == nil {
c.JSON(200, gin.H{"code": 401, "message": "token为空"}) c.JSON(200, gin.H{"code": 401, "message": "token为空"})
return return
} }
devices := worker.GetRedisSetMembers(token) devices := worker.GetRedisSetMembers(token.(string))
if len(devices) == 0 { if len(devices) == 0 {
c.JSON(200, gin.H{"code": 402, "message": "设备为空"}) c.JSON(200, gin.H{"code": 402, "message": "设备为空"})
return return