修复登陆密码判断bug

This commit is contained in:
bjdgyc
2021-03-02 15:28:08 +08:00
parent dd1eae5d32
commit ddba116fbf
4 changed files with 9 additions and 4 deletions

View File

@@ -2,5 +2,5 @@ package base
const (
APP_NAME = "AnyLink"
APP_VER = "0.1.6"
APP_VER = "0.1.7"
)

View File

@@ -86,8 +86,9 @@ func CheckUser(name, pwd, group string) error {
}
// 判断otp信息
pinCode := pwd
if !v.DisableOtp {
pwd = pwd[:pl-6]
pinCode = pwd[:pl-6]
otp := pwd[pl-6:]
if !checkOtp(name, otp, v.OtpSecret) {
return fmt.Errorf("%s %s", name, "动态码错误")
@@ -95,7 +96,7 @@ func CheckUser(name, pwd, group string) error {
}
// 判断用户密码
if pwd != v.PinCode {
if pinCode != v.PinCode {
return fmt.Errorf("%s %s", name, "密码错误")
}