public function img(){
$request = $this->request();
$file = $request->getUploadedFile('file');
$name = $file->getClientFilename();
$imgurl =EASYSWOOLE_ROOT.'/public/static/img/'.date("Ymd").'/'.$name;
$data = '/public/static/img/'.date("Ymd").'/'.$name;
$file->moveTo($imgurl);
$this->jsonData(200,$data,'上传成功');
}
EASYSWOOLE_ROOT必须使用这个绝对路径,不然守护进程启动,无法上传文件