Compare commits
2 Commits
35823bee30
...
28edd048ed
| Author | SHA1 | Date |
|---|---|---|
|
|
28edd048ed | |
|
|
b2053f14e4 |
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue