Compare commits
No commits in common. "f850749992bd288c7690ad4243bdd1ee182db86c" and "417d0aac813e7da8bfd4063d24a73e7ba85deeb0" have entirely different histories.
f850749992
...
417d0aac81
@ -95,33 +95,6 @@ func SaveRegister(c *gin.Context) {
|
|||||||
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
img := resp.Data.IdCardBackPhoto
|
|
||||||
|
|
||||||
response1, err := http.Get(img)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("网络请求错误:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
defer response1.Body.Close()
|
|
||||||
|
|
||||||
// 读取图片数据
|
|
||||||
imageData, err := ioutil.ReadAll(response1.Body)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("读取图片数据错误:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将图片数据转换为base64编码
|
|
||||||
base64Data := base64.StdEncoding.EncodeToString(imageData)
|
|
||||||
result, err := model.OcrGetIdCard(base64Data, "back")
|
|
||||||
if err != nil {
|
|
||||||
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp.Data.IdCardStartDate = result.IssueDate
|
|
||||||
resp.Data.IdCardEndDate = result.ExpirationDate
|
|
||||||
response.ResponseQuickMsg(c, msg.Ok, resp.Msg, resp)
|
response.ResponseQuickMsg(c, msg.Ok, resp.Msg, resp)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user