post =$this->request->post(); } public function query(){ $img= isset($this->post['img'])&&$this->post['img']!="" ? trim($this->post['img']):""; if($img==""){ return error_show(1005,"参数img不能为空"); } $ocr=new Ocr(); $data = $ocr->query("",$img); if($data['code']==0 && isset($data['data']['result'])){ return app_show(0,"识别成功",$data['data']['result']); }else{ return error_show(1005,"识别失败"); } } }