From b83195da919246a9b2b22451f5ff16784a561ba0 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Thu, 7 Nov 2024 15:52:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=8E=A7=E6=8E=A5=E5=8F=A3=E4=B8=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E7=99=BB=E5=BD=95=E6=A3=80=E6=B5=8B,?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF=E8=BF=94?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 4 ++++ proto/conf.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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"