From fbc8cf52013abd2d9d40d48c93346976d003238b Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Tue, 7 Jun 2022 16:49:09 +0800 Subject: [PATCH] add-api-idcard --- api/controllers/wxapp/licheb/Idcard.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/api/controllers/wxapp/licheb/Idcard.php b/api/controllers/wxapp/licheb/Idcard.php index 5810c3de..7af403fa 100644 --- a/api/controllers/wxapp/licheb/Idcard.php +++ b/api/controllers/wxapp/licheb/Idcard.php @@ -187,4 +187,19 @@ class Idcard extends Wxapp{ } } + + protected function get_info(){ + $img = $this->input_param('img'); + if(!$img){ + throw new Exception('参数错误', ERR_PARAMS_ERROR); + } + $full_cardidA = build_qiniu_image_url($img); + $result = $this->tcorc->IdentityCard($full_cardidA); + if(!$result['code']){ + throw new Exception('图片识别失败:'.$result['msg'], API_CODE_FAIL); + } + + $userinfo = $result['data']; + return $userinfo; + } }