修复monitor问题
This commit is contained in:
parent
f15a1d605b
commit
b2053f14e4
|
|
@ -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.Get("token")
|
token := c.Request.Header.Get("token")
|
||||||
if token == nil {
|
if token == "" {
|
||||||
c.JSON(200, gin.H{"code": 401, "message": "token为空"})
|
c.JSON(200, gin.H{"code": 401, "message": "token为空"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
devices := worker.GetRedisSetMembers(token.(string))
|
devices := worker.GetRedisSetMembers(token)
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue