|
@@ -7,6 +7,7 @@ use app\common\library\Ems;
|
|
|
use app\common\library\Sms;
|
|
|
use app\common\service\UserService;
|
|
|
use fast\Random;
|
|
|
+use think\Exception;
|
|
|
use think\Validate;
|
|
|
use miniprogram\wxBizDataCrypt;
|
|
|
use onlogin\onlogin;
|
|
@@ -916,8 +917,8 @@ class User extends Api
|
|
|
public function realauth()
|
|
|
{
|
|
|
try {
|
|
|
- $realName = $this->request->param('real_name',0);
|
|
|
- $idCard = $this->request->param('id_card',0);
|
|
|
+ $realName = $this->request->param('real_name','');
|
|
|
+ $idCard = $this->request->param('id_card','');
|
|
|
if ($this->auth->is_auth == 2) {
|
|
|
$this->error('您已经真人认证过了~');
|
|
|
}
|
|
@@ -927,7 +928,7 @@ class User extends Api
|
|
|
if (empty($idCard)) {
|
|
|
throw new Exception('请输入身份证号');
|
|
|
}
|
|
|
- $userService = new UserService();
|
|
|
+ /*$userService = new UserService();
|
|
|
$faceParams = [
|
|
|
'real_name' => $realName,
|
|
|
'id_card' => $idCard,
|
|
@@ -951,8 +952,26 @@ class User extends Api
|
|
|
'status' => 0,
|
|
|
'createtime' => time(),
|
|
|
'updatetime' => time()
|
|
|
+ ];*/
|
|
|
+ $userService = new UserService();
|
|
|
+ $aliParams = [
|
|
|
+ 'id_card' => $idCard,
|
|
|
+ 'real_name' => $realName,
|
|
|
+ ];
|
|
|
+ $aliCheckRes = $userService->aliCheck($aliParams);
|
|
|
+ if (!$aliCheckRes['status']) {
|
|
|
+ throw new Exception($aliCheckRes['msg']);
|
|
|
+ }
|
|
|
+ $user_auth = [
|
|
|
+ 'user_id' => $this->auth->id,
|
|
|
+ 'realname' => $realName,
|
|
|
+ 'idcard' => $idCard,
|
|
|
+ 'certify_id' => '',
|
|
|
+ 'out_trade_no' => '',
|
|
|
+ 'status' => 0,
|
|
|
+ 'createtime' => time(),
|
|
|
+ 'updatetime' => time()
|
|
|
];
|
|
|
-
|
|
|
//开启事务
|
|
|
Db::startTrans();
|
|
|
//查询是否认证过
|
|
@@ -974,15 +993,14 @@ class User extends Api
|
|
|
}
|
|
|
|
|
|
Db::commit();
|
|
|
-
|
|
|
- $return_data = [
|
|
|
+ /*$return_data = [
|
|
|
'face_id' => $user_auth['certify_id'],
|
|
|
'order_no' => $user_auth['out_trade_no'],
|
|
|
'user_id' => (string)$this->auth->id,
|
|
|
'nonce' => $rs['nonce'],
|
|
|
'sign' => $rs['sign'],
|
|
|
- ];
|
|
|
- $this->success('success', $return_data);
|
|
|
+ ];*/
|
|
|
+ $this->success('验证成功');
|
|
|
} catch (Exception $e) {
|
|
|
$this->error($e->getMessage());
|
|
|
}
|