diff --git a/handler/tool.go b/handler/tool.go index 217497f..1ddb1a0 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -48,6 +48,10 @@ func SetDeviceStatusV2(c *gin.Context) { return } else { token, _ := c.Get("token") + if token == nil { + c.JSON(200, gin.H{"code": 401, "message": "token为空"}) + return + } devices := worker.GetRedisSetMembers(token.(string)) if len(devices) == 0 { c.JSON(200, gin.H{"code": 402, "message": "设备为空"}) diff --git a/proto/conf.go b/proto/conf.go index cc4fbdb..97a207e 100644 --- a/proto/conf.go +++ b/proto/conf.go @@ -9,7 +9,7 @@ import ( var Config ConfigStruct var SigningKey = []byte{} -var Url_map = map[string]bool{"/login": true, "/register": true, "/uuid": true, "/gqr": true, "/cid/callback": true} +var Url_map = map[string]bool{"/login": true, "/register": true, "/uuid": true, "/gqr": true, "/cid/callback": true, "/tool/monitor": true} const ( MYSQL_USER = "video_t2"