实名认证修改

This commit is contained in:
2025-09-17 15:13:59 +08:00
parent c95f8cb091
commit e5086254c3
2 changed files with 12 additions and 3 deletions

View File

@@ -838,7 +838,13 @@ class Tencent extends Model
// 处理响应 // 处理响应
if ($httpCode == 200) { 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 { } else {
return ['code' => $httpCode, 'msg' => '接口请求失败']; return ['code' => $httpCode, 'msg' => '接口请求失败'];
} }

View File

@@ -288,9 +288,9 @@ class UserData extends Model
return ['code' => 0, 'msg' => '请先绑定手机号','data' =>null]; 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){ if($is_real){
return ['code' => 0, 'msg' => '请勿重复提交','data' =>null]; return ['code' => 0, 'msg' => '已经提交审核了,请等待验证结果!','data' =>null];
} }
$auth = [ $auth = [
'mobile' => $user_mobile, 'mobile' => $user_mobile,
@@ -326,6 +326,9 @@ class UserData extends Model
$sign = model('Tencent')->getSign($user_id,$nonceStr,$sign_ticket,$config['tencent_app_id']); $sign = model('Tencent')->getSign($user_id,$nonceStr,$sign_ticket,$config['tencent_app_id']);
//生成faceId //生成faceId
$faceId = model('Tencent')->getFaceId($orderNo,$real_name,$id_card,$sign,$user_id,$config['tencent_app_id'],$nonceStr); $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 = [ $data = [
'userid' => 'u'.$user_id, 'userid' => 'u'.$user_id,