|
...
|
...
|
@@ -9,6 +9,8 @@ use App\Exceptions\AsideGlobalException; |
|
|
|
use App\Exceptions\BsideGlobalException;
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Models\Devops\ServerInformationLog;
|
|
|
|
use App\Models\File\Image;
|
|
|
|
use App\Services\CosService;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
...
|
...
|
@@ -380,7 +382,33 @@ class Logic |
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取图片链接
|
|
|
|
* @name :getImageUrl
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/20 16:46
|
|
|
|
*/
|
|
|
|
public function getImageUrl($hash){
|
|
|
|
|
|
|
|
if(is_array($hash)){
|
|
|
|
$url = [];
|
|
|
|
foreach ($hash as $k => $v){
|
|
|
|
$url['images_link'][$k] = $this->getImageUrl($v);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$imageModel = new Image();
|
|
|
|
$info = $imageModel->read(['hash'=>$hash]);
|
|
|
|
if($info['is_cos'] == 1){
|
|
|
|
$cos = new CosService();
|
|
|
|
$url = $cos->getImageUrl($info['path']);
|
|
|
|
}else{
|
|
|
|
$url = url('b/image/'.$info['hash']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $url;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取实例
|
...
|
...
|
|