fix
This commit is contained in:
@@ -77,34 +77,23 @@ func (l *QueryServiceLogic) VerifyCode(mobile string, code string) error {
|
||||
|
||||
// 三要素验证
|
||||
func (l *QueryServiceLogic) Verify(Name string, IDCard string, Mobile string) error {
|
||||
// fmt.Println("Mobile", Mobile)
|
||||
// // 下午18点到次日早上8点半调用二要素,其余时间三要素
|
||||
// now := time.Now()
|
||||
// // 获取当前小时和分钟
|
||||
// hour := now.Hour()
|
||||
// minute := now.Minute()
|
||||
|
||||
// 判断是否在18:00到次日8:30之间
|
||||
// if hour >= 18 || (hour < 8) || (hour == 8 && minute < 30) {
|
||||
// 二要素验证
|
||||
if l.svcCtx.Config.VerifyConfig.TwoFactor {
|
||||
// 2025年8月18日上午8点30分之前都是二要素,过后是三要素
|
||||
now := time.Now()
|
||||
// 设定分界时间:2025年8月18日8点30分
|
||||
switchTime := time.Date(2025, 8, 18, 8, 30, 0, 0, now.Location())
|
||||
if now.Before(switchTime) {
|
||||
// 二要素验证
|
||||
twoFactorsErr := l.VerifyTwoFactors(Name, IDCard)
|
||||
if twoFactorsErr != nil {
|
||||
return twoFactorsErr
|
||||
}
|
||||
} else {
|
||||
// 三要素验证
|
||||
threeFactorsErr := l.VerifyThreeFactors(Name, IDCard, Mobile)
|
||||
if threeFactorsErr != nil {
|
||||
return threeFactorsErr
|
||||
}
|
||||
}
|
||||
// } else {
|
||||
// // 三要素验证
|
||||
// threeFactorsErr := l.VerifyThreeFactors(Name, IDCard, Mobile)
|
||||
// if threeFactorsErr != nil {
|
||||
// return threeFactorsErr
|
||||
// }
|
||||
// }
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user