|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
+use app\admin\model\user\Id;
|
|
|
use app\admin\model\yexam\Third;
|
|
|
use app\api\library\Mp;
|
|
|
use app\common\controller\Api;
|
|
@@ -351,4 +352,28 @@ class User extends Api
|
|
|
$this->error($this->auth->getError());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 验证用户信息
|
|
|
+ * @ApiParams (name="name",description="姓名")
|
|
|
+ * @ApiParams (name="id_no",description="身份证号码")
|
|
|
+ */
|
|
|
+ public function verify_id(){
|
|
|
+ $data=input();
|
|
|
+ $user=$this->auth->getUser();
|
|
|
+ if($user['user_id']){
|
|
|
+ $this->success();
|
|
|
+ }
|
|
|
+ $this->validate($data,[
|
|
|
+ 'name'=>['require'],
|
|
|
+ 'id_no'=>['require'],
|
|
|
+ ]);
|
|
|
+ $id=Id::where('name',$data['name'])->where('id_no',$data['id_no'])->find();
|
|
|
+ if(!$id){
|
|
|
+ $this->error('认证失败');
|
|
|
+ }
|
|
|
+ $user['user_id']=$id['id'];
|
|
|
+ $user->save();
|
|
|
+ $this->success();
|
|
|
+ }
|
|
|
}
|