From e5086254c3bf7d8725fc468e888b884ea5341539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Wed, 17 Sep 2025 15:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Tencent.php | 8 +++++++- application/api/model/UserData.php | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/application/api/model/Tencent.php b/application/api/model/Tencent.php index 63d2e5b..eb634cf 100644 --- a/application/api/model/Tencent.php +++ b/application/api/model/Tencent.php @@ -838,7 +838,13 @@ class Tencent extends Model // 处理响应 if ($httpCode == 200) { - return json_decode($response, true)['result']['faceId']; + $red = json_decode($response, true); + if ($red['code'] == 0) { + return $red['result']['faceId']; + } else { + return ['code' => 0, 'msg' => $red['msg'], 'data' => null]; + } +// return json_decode($response, true)['result']['faceId']; } else { return ['code' => $httpCode, 'msg' => '接口请求失败']; } diff --git a/application/api/model/UserData.php b/application/api/model/UserData.php index f8ff74d..da8a728 100644 --- a/application/api/model/UserData.php +++ b/application/api/model/UserData.php @@ -288,9 +288,9 @@ class UserData extends Model return ['code' => 0, 'msg' => '请先绑定手机号','data' =>null]; } //查询是否已经提交过数据了 - $is_real = db::name('user_auth')->where(['card_id' => $id_card])->find(); + $is_real = db::name('user_auth')->where(['card_id' => $id_card,'is_real' => 1])->find(); if($is_real){ - return ['code' => 0, 'msg' => '请勿重复提交','data' =>null]; + return ['code' => 0, 'msg' => '已经提交审核了,请等待验证结果!','data' =>null]; } $auth = [ 'mobile' => $user_mobile, @@ -326,6 +326,9 @@ class UserData extends Model $sign = model('Tencent')->getSign($user_id,$nonceStr,$sign_ticket,$config['tencent_app_id']); //生成faceId $faceId = model('Tencent')->getFaceId($orderNo,$real_name,$id_card,$sign,$user_id,$config['tencent_app_id'],$nonceStr); + if(isset($faceId['code'])){ + return ['code' => 0, 'msg' => $faceId['msg'],'data' =>null]; + } $data = [ 'userid' => 'u'.$user_id,