|
@@ -59,8 +59,7 @@ class ImageController |
|
@@ -59,8 +59,7 @@ class ImageController |
|
59
|
[$last_modified_time, $hash . ':' . $w . '_' . $h . '_' . 2, $last_modified_time], $this->upload_img['header']);
|
59
|
[$last_modified_time, $hash . ':' . $w . '_' . $h . '_' . 2, $last_modified_time], $this->upload_img['header']);
|
|
60
|
$content = file_get_contents($filename);
|
60
|
$content = file_get_contents($filename);
|
|
61
|
$header['Content-Length'] = $info['size'];
|
61
|
$header['Content-Length'] = $info['size'];
|
|
62
|
- return response($content, 200, $header);
|
|
|
|
63
|
- }
|
62
|
+ }else{
|
|
64
|
$path = $info['path'];
|
63
|
$path = $info['path'];
|
|
65
|
if (!is_file($path)) {
|
64
|
if (!is_file($path)) {
|
|
66
|
$this->response('指定图片已被系统删除!', Code::USER_ERROR);
|
65
|
$this->response('指定图片已被系统删除!', Code::USER_ERROR);
|
|
@@ -77,6 +76,7 @@ class ImageController |
|
@@ -77,6 +76,7 @@ class ImageController |
|
77
|
$content = file_get_contents($path);
|
76
|
$content = file_get_contents($path);
|
|
78
|
$header['Content-Length'] = $info['size'];
|
77
|
$header['Content-Length'] = $info['size'];
|
|
79
|
}
|
78
|
}
|
|
|
|
79
|
+ }
|
|
80
|
$img_type = $info['type'];
|
80
|
$img_type = $info['type'];
|
|
81
|
$content = base64_encode($content);
|
81
|
$content = base64_encode($content);
|
|
82
|
$img_base64 = 'data:image/' . $img_type . ';base64,' . $content;
|
82
|
$img_base64 = 'data:image/' . $img_type . ';base64,' . $content;
|