feat(user): 新增三要素

This commit is contained in:
2024-11-25 00:25:48 +08:00
parent 6f77085c72
commit f13dcda370
9 changed files with 178 additions and 35 deletions

View File

@@ -74,17 +74,30 @@ func (l *HomeServiceLogic) HomeService(req *types.QueryReq) (resp *types.QueryRe
}
// 3、二要素三要素核验
twoVerification := service.TwoFactorVerificationRequest{
//twoVerification := service.TwoFactorVerificationRequest{
// Name: data.Name,
// IDCard: data.IDCard,
//}
//verification, err := l.svcCtx.VerificationService.TwoFactorVerification(twoVerification)
//if err != nil {
// return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "家政服务, 二要素验证失败: %+v", err)
//}
//if !verification.Passed {
// return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.SERVER_COMMON_ERROR, verification.Err.Error()), "家政服务, 二要素验证不通过: %+v", err)
//}
// 3、二要素三要素核验
threeVerification := service.ThreeFactorVerificationRequest{
Name: data.Name,
IDCard: data.IDCard,
}
verification, err := l.svcCtx.VerificationService.TwoFactorVerification(twoVerification)
verification, err := l.svcCtx.VerificationService.ThreeFactorVerification(threeVerification)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "家政服务, 要素验证失败: %+v", err)
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "家政服务, 要素验证失败: %+v", err)
}
if !verification.Passed {
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.SERVER_COMMON_ERROR, verification.Err.Error()), "家政服务, 要素验证不通过: %+v", err)
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.SERVER_COMMON_ERROR, verification.Err.Error()), "家政服务, 要素验证不通过: %+v", err)
}
// 缓存
queryCache := types.QueryCache{
Name: data.Name,