From c5ac10b11c960c0a3213f3daba24a8170dc71f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A5=E4=B8=8B=E9=83=A8=20=E8=A9=A9?= Date: Sat, 20 Feb 2021 23:17:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=98=E8=AE=B0=E5=AF=86=E7=A0=81=E4=BB=A5?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E9=87=8D=E8=AE=BE=E4=BA=8C=E6=AD=A5=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E8=AE=BE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/user/login.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/user/login.go b/service/user/login.go index acea163..68fbe2b 100644 --- a/service/user/login.go +++ b/service/user/login.go @@ -62,7 +62,10 @@ func (service *UserResetService) Reset(c *gin.Context) serializer.Response { if err := user.Update(map[string]interface{}{"password": user.Password}); err != nil { return serializer.DBErr("无法重设密码", err) } - + // 重设二步验证设定 + if err := user.Update(map[string]interface{}{"two_factor": ""}); err != nil { + return serializer.DBErr("无法更新二步验证设定", err) + } cache.Deletes([]string{fmt.Sprintf("%d", uid)}, "user_reset_") return serializer.Response{} }