<?php


namespace app\controller;


use think\facade\Request;
use think\response\Json;

class Ocr extends CommonController
{
    public function submit():Json
    {
        $file =  Request::file('file');
        if ($file->getSize() > (4*1024*1024)){
            return $this->_json_error('文件不能超过4M！');
        }
	print_r($file);die;
        $text = CommonController::callOcr($file);
        $data = CommonController::formatTestSheet($text);
        return $this->_json_succ($data);
    }
}

