|
@@ -9,6 +9,8 @@ use App\Exceptions\AsideGlobalException; |
|
@@ -9,6 +9,8 @@ use App\Exceptions\AsideGlobalException; |
|
9
|
use App\Exceptions\BsideGlobalException;
|
9
|
use App\Exceptions\BsideGlobalException;
|
|
10
|
use App\Helper\Arr;
|
10
|
use App\Helper\Arr;
|
|
11
|
use App\Models\Devops\ServerInformationLog;
|
11
|
use App\Models\Devops\ServerInformationLog;
|
|
|
|
12
|
+use App\Models\File\Image;
|
|
|
|
13
|
+use App\Services\CosService;
|
|
12
|
use Illuminate\Database\Eloquent\Model;
|
14
|
use Illuminate\Database\Eloquent\Model;
|
|
13
|
use Illuminate\Support\Facades\Cache;
|
15
|
use Illuminate\Support\Facades\Cache;
|
|
14
|
use Illuminate\Support\Facades\DB;
|
16
|
use Illuminate\Support\Facades\DB;
|
|
@@ -380,7 +382,33 @@ class Logic |
|
@@ -380,7 +382,33 @@ class Logic |
|
380
|
return $this->success($info);
|
382
|
return $this->success($info);
|
|
381
|
}
|
383
|
}
|
|
382
|
|
384
|
|
|
|
|
385
|
+ /**
|
|
|
|
386
|
+ * @remark :获取图片链接
|
|
|
|
387
|
+ * @name :getImageUrl
|
|
|
|
388
|
+ * @author :lyh
|
|
|
|
389
|
+ * @method :post
|
|
|
|
390
|
+ * @time :2023/7/20 16:46
|
|
|
|
391
|
+ */
|
|
|
|
392
|
+ public function getImageUrl($hash){
|
|
383
|
|
393
|
|
|
|
|
394
|
+ if(is_array($hash)){
|
|
|
|
395
|
+ $url = [];
|
|
|
|
396
|
+ foreach ($hash as $k => $v){
|
|
|
|
397
|
+ $url['images_link'][$k] = $this->getImageUrl($v);
|
|
|
|
398
|
+ }
|
|
|
|
399
|
+ }else{
|
|
|
|
400
|
+ $imageModel = new Image();
|
|
|
|
401
|
+ $info = $imageModel->read(['hash'=>$hash]);
|
|
|
|
402
|
+ if($info['is_cos'] == 1){
|
|
|
|
403
|
+ $cos = new CosService();
|
|
|
|
404
|
+ $url = $cos->getImageUrl($info['path']);
|
|
|
|
405
|
+ }else{
|
|
|
|
406
|
+ $url = url('b/image/'.$info['hash']);
|
|
|
|
407
|
+ }
|
|
|
|
408
|
+ }
|
|
|
|
409
|
+
|
|
|
|
410
|
+ return $url;
|
|
|
|
411
|
+ }
|
|
384
|
|
412
|
|
|
385
|
/**
|
413
|
/**
|
|
386
|
* 获取实例
|
414
|
* 获取实例
|