|
@@ -241,12 +241,15 @@ class BaseController extends Controller |
|
@@ -241,12 +241,15 @@ 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
|
+ $url = '';
|
|
|
|
245
|
+ if($info !== false){
|
|
244
|
if($info['is_cos'] == 1){
|
246
|
if($info['is_cos'] == 1){
|
|
245
|
$cos = new CosService();
|
247
|
$cos = new CosService();
|
|
246
|
$url = $cos->getImageUrl($info['path']);
|
248
|
$url = $cos->getImageUrl($info['path']);
|
|
247
|
}else{
|
249
|
}else{
|
|
248
|
$url = url('b/image/'.$info['hash']);
|
250
|
$url = url('b/image/'.$info['hash']);
|
|
249
|
}
|
251
|
}
|
|
|
|
252
|
+ }
|
|
250
|
return $url;
|
253
|
return $url;
|
|
251
|
}
|
254
|
}
|
|
252
|
|
255
|
|