From 5356efaa7376e90d25e71dca0c14d712cef119ac Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Mon, 16 Dec 2024 21:31:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B6=85=E7=BA=A7=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 5 ++++- service/userService.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 7c51506..eee8f2b 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "io" "log" "os" + "strconv" "strings" "videoplayer/dao" "videoplayer/handler" @@ -142,7 +143,9 @@ func JWTAuthMiddleware() gin.HandlerFunc { }) return } - c.Set("id", s_id) + id, _ := strconv.Atoi(s_id) + //查看s_id类型 + c.Set("id", id) c.Next() return } diff --git a/service/userService.go b/service/userService.go index 3357789..ad44cb6 100644 --- a/service/userService.go +++ b/service/userService.go @@ -112,7 +112,7 @@ func UserSyncDataFromMaster() { req.Token = tokens[0] req.Device = proto.Config.SERVER_NAME all := worker.GetRedis("user_sync_all") - var is_all bool //是否全量同步 + is_all := false //是否全量同步 if all == "" || all == "1" { is_all = true //清空数据表