From cb9d023a9621147511c16c2776496e33f86eb700 Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Wed, 23 Oct 2024 18:13:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/dbdata/user.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/dbdata/user.go b/server/dbdata/user.go index 18db099..b4d7817 100644 --- a/server/dbdata/user.go +++ b/server/dbdata/user.go @@ -117,13 +117,13 @@ func checkLocalUser(name, pwd, group string) error { } // 判断otp信息 pinCode := pwd - // if !v.DisableOtp { - // pinCode = pwd[:pl-6] - // otp := pwd[pl-6:] - // if !CheckOtp(name, otp, v.OtpSecret) { - // return fmt.Errorf("%s %s", name, "动态码错误") - // } - // } + if !v.DisableOtp { + pinCode = pwd[:pl-6] + otp := pwd[pl-6:] + if !CheckOtp(name, otp, v.OtpSecret) { + return fmt.Errorf("%s %s", name, "动态码错误") + } + } // 判断用户密码 if pinCode != v.PinCode {