作者 liyuhang

gx

@@ -158,7 +158,7 @@ class BaseController extends Controller @@ -158,7 +158,7 @@ class BaseController extends Controller
158 } 158 }
159 switch ((string) $k) { 159 switch ((string) $k) {
160 case 'image': 160 case 'image':
161 - $v['image_link'] = url('/image/' . $v); 161 + $data['image_link'] = url('/b/image/' . $v);
162 break; 162 break;
163 } 163 }
164 } 164 }
@@ -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;