feat(user): 添加临时查询

This commit is contained in:
2024-11-25 01:05:25 +08:00
parent 8bad1bc71b
commit ceb801cae7
8 changed files with 161 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ import (
"net/http"
"net/url"
"qnc-server/app/user/cmd/api/internal/config"
"qnc-server/pkg/lzkit/crypto"
"strings"
)
@@ -126,12 +127,25 @@ func (r *VerificationService) TwoFactorVerification(request TwoFactorVerificatio
return &VerificationResult{Passed: true, Err: nil}, nil
}
func (r *VerificationService) ThreeFactorVerification(request ThreeFactorVerificationRequest) (*VerificationResult, error) {
threeElementsReq := map[string]interface{}{
"name": request.Name,
"idNo": request.IDCard,
"phone": request.Mobile,
westName, err := crypto.WestDexEncrypt(request.Name, r.c.WestConfig.Key)
if err != nil {
return nil, err
}
westIDCard, err := crypto.WestDexEncrypt(request.IDCard, r.c.WestConfig.Key)
if err != nil {
return nil, err
}
westPhone, err := crypto.WestDexEncrypt(request.Mobile, r.c.WestConfig.Key)
if err != nil {
return nil, err
}
threeElementsReq := map[string]interface{}{
"data": map[string]interface{}{
"name": westName,
"idNo": westIDCard,
"phone": westPhone,
},
}
resp, err := r.westDexService.CallAPI("G15BJ02", threeElementsReq)
if err != nil {
return nil, err