mirror of https://github.com/bjdgyc/anylink.git
修复登陆密码判断bug
This commit is contained in:
parent
dd1eae5d32
commit
ddba116fbf
|
@ -1,3 +1,5 @@
|
||||||
# Binaries for programs and plugins
|
# Binaries for programs and plugins
|
||||||
.idea/
|
.idea/
|
||||||
anylink-deploy
|
anylink-deploy
|
||||||
|
ui
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ AnyLink 服务端仅在CentOS 7、Ubuntu 18.04测试通过,如需要安装在
|
||||||
git clone https://github.com/bjdgyc/anylink.git
|
git clone https://github.com/bjdgyc/anylink.git
|
||||||
|
|
||||||
cd anylink
|
cd anylink
|
||||||
sh build.sh
|
sh -x build.sh
|
||||||
|
|
||||||
# 注意使用root权限运行
|
# 注意使用root权限运行
|
||||||
cd anylink-deploy
|
cd anylink-deploy
|
||||||
|
@ -42,6 +42,8 @@ sudo ./anylink -conf="conf/server.toml"
|
||||||
|
|
||||||
# 默认管理后台访问地址
|
# 默认管理后台访问地址
|
||||||
# http://host:8800
|
# http://host:8800
|
||||||
|
# 默认日志文件
|
||||||
|
# log/anylink.log
|
||||||
```
|
```
|
||||||
|
|
||||||
## Feature
|
## Feature
|
||||||
|
|
|
@ -2,5 +2,5 @@ package base
|
||||||
|
|
||||||
const (
|
const (
|
||||||
APP_NAME = "AnyLink"
|
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信息
|
// 判断otp信息
|
||||||
|
pinCode := pwd
|
||||||
if !v.DisableOtp {
|
if !v.DisableOtp {
|
||||||
pwd = pwd[:pl-6]
|
pinCode = pwd[:pl-6]
|
||||||
otp := pwd[pl-6:]
|
otp := pwd[pl-6:]
|
||||||
if !checkOtp(name, otp, v.OtpSecret) {
|
if !checkOtp(name, otp, v.OtpSecret) {
|
||||||
return fmt.Errorf("%s %s", name, "动态码错误")
|
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, "密码错误")
|
return fmt.Errorf("%s %s", name, "密码错误")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue