|
...
|
...
|
@@ -56,8 +56,6 @@ class ImageController extends Controller |
|
|
|
}
|
|
|
|
$this->param = $this->request->all();
|
|
|
|
$this->config = config('filesystems.disks.upload');
|
|
|
|
var_dump($this->config);
|
|
|
|
die();
|
|
|
|
$this->uploads = config('upload.default_image');
|
|
|
|
//上传路径设置
|
|
|
|
if(!isset($this->param['image_type'])){
|
|
...
|
...
|
@@ -90,7 +88,7 @@ class ImageController extends Controller |
|
|
|
$this->response('指定图片不存在!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
//查看缩略图是否存在
|
|
|
|
$filename = $this->config['url'].'/'.$this->path . '/' . $info['hash'] . $w . '_' . $h;
|
|
|
|
$filename = $this->config['root'].'/'.$this->path . '/' . $info['hash'] . $w . '_' . $h;
|
|
|
|
if(is_file($filename)){
|
|
|
|
$last_modified_time = gmdate(time() + ((30 * 60 * 60 * 24))) . " GMT";
|
|
|
|
$header = str_replace(['%Expires%', "%etag%", '%Last-Modified%'],
|
|
...
|
...
|
@@ -160,7 +158,9 @@ class ImageController extends Controller |
|
|
|
if($image_hash !== false){
|
|
|
|
return $this->response('图片资源',Code::SUCCESS,['image'=>$hash]);
|
|
|
|
}
|
|
|
|
$url = $this->config['url'].$this->path;
|
|
|
|
$url = $this->config['root'].'/'.$this->path;
|
|
|
|
var_dump($url);
|
|
|
|
die();
|
|
|
|
$fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension();
|
|
|
|
$res = $files->move($url,$fileName);
|
|
|
|
if ($res === false) {
|
|
...
|
...
|
@@ -221,7 +221,7 @@ class ImageController extends Controller |
|
|
|
$data[] = ['image'=>$hash];
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$url = $this->config['url'].$this->path;
|
|
|
|
$url = $this->config['root'].$this->path;
|
|
|
|
$fileName = uniqid().rand(10000,99999).'.'.$file->getClientOriginalExtension();
|
|
|
|
$res = $file->move($url,$fileName);
|
|
|
|
if ($res === false) {
|
...
|
...
|
|