From 2ee51cd9577b75aaa5c1340e68b26f2a72cf6bf6 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Thu, 13 Jun 2024 11:23:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dredis=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=80=BC=E7=9A=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/user.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handler/user.go b/handler/user.go index 7079247..d8ea2c2 100644 --- a/handler/user.go +++ b/handler/user.go @@ -58,7 +58,7 @@ func SetQRStatus(c *gin.Context) { var qrsetReq QRReq if err := c.ShouldBind(&qrsetReq); err == nil || qrsetReq.UUID != "" { if worker.IsContainKey(qrsetReq.UUID) == false { - c.JSON(200, gin.H{"code": 18, "message": "uuid not found", "data": "0"}) + c.JSON(200, gin.H{"code": 18, "message": "uuid not found in server", "data": "0"}) return } res := worker.SetHashWithField(qrsetReq.UUID, "status", "1") @@ -85,6 +85,10 @@ func ConfirmQRLogin(c *gin.Context) { if token == "" { c.JSON(200, gin.H{"code": 20, "message": "Token不存在", "data": "20"}) } + if worker.IsContainKey(qrsetReq.UUID) == false { + c.JSON(200, gin.H{"code": 18, "message": "uuid not found in server", "data": "0"}) + return + } if worker.SetHashWithField(qrsetReq.UUID, "status", token) { c.JSON(200, gin.H{"code": 0, "message": "success", "data": "0"}) } else {