获取实名信息
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use app\api\model\BrowserVerify;
|
use app\api\model\BrowserVerify;
|
||||||
|
use app\api\model\User;
|
||||||
|
|
||||||
class Verify
|
class Verify
|
||||||
{
|
{
|
||||||
@@ -21,4 +22,46 @@ class Verify
|
|||||||
result([], 'false', 30000);
|
result([], 'false', 30000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//验证用户是否实名
|
||||||
|
public function userverify() {
|
||||||
|
$post = $_POST;
|
||||||
|
|
||||||
|
if (empty($post)) {
|
||||||
|
$post = json_decode(file_get_contents("php://input"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = $post['phone'];
|
||||||
|
$id_code = $post['id'];
|
||||||
|
|
||||||
|
if (empty($username) || empty($id_code)) {
|
||||||
|
$return_data = [
|
||||||
|
'code' => -1,
|
||||||
|
'msg' => '身份证号或手机号不能为空',
|
||||||
|
];
|
||||||
|
echo json_encode($return_data);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
|
$user_model = new User;
|
||||||
|
|
||||||
|
$userinfo = $user_model->getOne(['id_code'=>$id_code], 'is_verify');
|
||||||
|
|
||||||
|
if ($userinfo['is_verify']) {
|
||||||
|
$return_data = [
|
||||||
|
'code' => 1,
|
||||||
|
'msg' => '实名认证成功',
|
||||||
|
];
|
||||||
|
echo json_encode($return_data);
|
||||||
|
die;
|
||||||
|
} else {
|
||||||
|
$return_data = [
|
||||||
|
'code' => -1,
|
||||||
|
'msg' => '实名认证失败',
|
||||||
|
];
|
||||||
|
echo json_encode($return_data);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user