123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app\admin\controller;
- use app\admin\common\Ocr;
- use app\command\qrd;
- use think\App;
- class Ocrlicense extends \app\BaseController
- {
- public $post=[];
- public $white=["*"];
- public function __construct(App $app)
- {
- parent::__construct($app);
- $this->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,"识别失败");
- }
- }
- }
|