作者 lyh

gx

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