From 276f7eec87f5958626c9217166105ede4f3f6be5 Mon Sep 17 00:00:00 2001 From: PatrickStar <1592810043@qq.com> Date: Mon, 17 Jul 2023 18:04:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/userController/bind.go | 4 +++- app/services/userServices/setUser.go | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/userController/bind.go b/app/controllers/userController/bind.go index 68b55db..f8d56d4 100644 --- a/app/controllers/userController/bind.go +++ b/app/controllers/userController/bind.go @@ -71,6 +71,7 @@ func BindLibraryPassword(c *gin.Context) { utils.JsonSuccessResponse(c, nil) } +// SendVerificationCode 这一函数实际上不再被使用 func SendVerificationCode(c *gin.Context) { var postForm phoneForm err := c.ShouldBindJSON(&postForm) @@ -118,7 +119,7 @@ func GetCaptcha(c *gin.Context) { } u := uuid.New() deviceId := u.String() - redis.RedisClient.Set(context.Background(), user.Username + "_device_id", deviceId, time.Minute * 5) + redis.RedisClient.Set(context.Background(), user.Username+"_device_id", deviceId, time.Minute*5) data, err := yxyServices.GetSecurityToken(deviceId) if err != nil { _ = c.AbortWithError(200, apiException.ServerError) @@ -189,6 +190,7 @@ func LoginYxy(c *gin.Context) { return } userServices.SetDeviceID(user, deviceId) + userServices.DecryptUserKeyInfo(user) userServices.SetYxyUid(user, *uid) userServices.DecryptUserKeyInfo(user) userServices.SetPhoneNum(user, postForm.PhoneNum) diff --git a/app/services/userServices/setUser.go b/app/services/userServices/setUser.go index 978987c..fe8a716 100644 --- a/app/services/userServices/setUser.go +++ b/app/services/userServices/setUser.go @@ -48,6 +48,10 @@ func SetDeviceID(user *models.User, deviceID string) { } func DelPassword(user *models.User, passwordType string) { + if user.Username == "202103150901" { + println(user.ZFPassword) + println(user.LibPassword) + } switch passwordType { case "ZF": { From 27b8e86160a2f4a60aad9e0ef684449294dce52b Mon Sep 17 00:00:00 2001 From: PatrickStar <1592810043@qq.com> Date: Mon, 17 Jul 2023 18:58:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/userServices/setUser.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/services/userServices/setUser.go b/app/services/userServices/setUser.go index fe8a716..978987c 100644 --- a/app/services/userServices/setUser.go +++ b/app/services/userServices/setUser.go @@ -48,10 +48,6 @@ func SetDeviceID(user *models.User, deviceID string) { } func DelPassword(user *models.User, passwordType string) { - if user.Username == "202103150901" { - println(user.ZFPassword) - println(user.LibPassword) - } switch passwordType { case "ZF": {