|
@@ -241,11 +241,14 @@ class BaseController extends Controller |
|
@@ -241,11 +241,14 @@ class BaseController extends Controller |
|
241
|
public function getImageUrl($hash){
|
241
|
public function getImageUrl($hash){
|
|
242
|
$imageModel = new Image();
|
242
|
$imageModel = new Image();
|
|
243
|
$info = $imageModel->read(['hash'=>$hash]);
|
243
|
$info = $imageModel->read(['hash'=>$hash]);
|
|
244
|
- if($info['is_cos'] == 1){
|
|
|
|
245
|
- $cos = new CosService();
|
|
|
|
246
|
- $url = $cos->getImageUrl($info['path']);
|
|
|
|
247
|
- }else{
|
|
|
|
248
|
- $url = url('b/image/'.$info['hash']);
|
244
|
+ $url = '';
|
|
|
|
245
|
+ if($info !== false){
|
|
|
|
246
|
+ if($info['is_cos'] == 1){
|
|
|
|
247
|
+ $cos = new CosService();
|
|
|
|
248
|
+ $url = $cos->getImageUrl($info['path']);
|
|
|
|
249
|
+ }else{
|
|
|
|
250
|
+ $url = url('b/image/'.$info['hash']);
|
|
|
|
251
|
+ }
|
|
249
|
}
|
252
|
}
|
|
250
|
return $url;
|
253
|
return $url;
|
|
251
|
}
|
254
|
}
|