mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-07 18:51:49 +08:00
修复登陆密码判断bug
This commit is contained in:
@@ -2,5 +2,5 @@ package base
|
||||
|
||||
const (
|
||||
APP_NAME = "AnyLink"
|
||||
APP_VER = "0.1.6"
|
||||
APP_VER = "0.1.7"
|
||||
)
|
||||
|
@@ -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, "密码错误")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user