Merge branch 'main' of http://1.117.67.95:3000/team/tyapi-server
This commit is contained in:
@@ -40,6 +40,17 @@ func callAliyunIDCardCheckRaw(ctx context.Context, deps *processors.ProcessorDep
|
|||||||
}
|
}
|
||||||
|
|
||||||
var aliyunData struct {
|
var aliyunData struct {
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
Success bool `json:"success"`
|
||||||
|
Code int `json:"code"`
|
||||||
|
Data struct {
|
||||||
|
Birthday string `json:"birthday"`
|
||||||
|
Result interface{} `json:"result"`
|
||||||
|
Address string `json:"address"`
|
||||||
|
OrderNo string `json:"orderNo"`
|
||||||
|
Sex string `json:"sex"`
|
||||||
|
Desc string `json:"desc"`
|
||||||
|
} `json:"data"`
|
||||||
Result interface{} `json:"result"`
|
Result interface{} `json:"result"`
|
||||||
Desc string `json:"desc"`
|
Desc string `json:"desc"`
|
||||||
}
|
}
|
||||||
@@ -47,7 +58,15 @@ func callAliyunIDCardCheckRaw(ctx context.Context, deps *processors.ProcessorDep
|
|||||||
return nil, errors.Join(processors.ErrSystem, err)
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resultCode, verifyResult, resultMsg := mapIDCardCheckResult(aliyunData.Result, aliyunData.Desc)
|
rawResult := aliyunData.Result
|
||||||
|
rawDesc := aliyunData.Desc
|
||||||
|
// 优先使用 code=200 时 data 内的字段;兼容旧格式直接返回 result/desc
|
||||||
|
if aliyunData.Code == 200 {
|
||||||
|
rawResult = aliyunData.Data.Result
|
||||||
|
rawDesc = aliyunData.Data.Desc
|
||||||
|
}
|
||||||
|
|
||||||
|
resultCode, verifyResult, resultMsg := mapIDCardCheckResult(rawResult, rawDesc)
|
||||||
response := map[string]interface{}{
|
response := map[string]interface{}{
|
||||||
"ctidRequest": map[string]interface{}{
|
"ctidRequest": map[string]interface{}{
|
||||||
"ctidAuth": map[string]interface{}{
|
"ctidAuth": map[string]interface{}{
|
||||||
|
|||||||
Reference in New Issue
Block a user