|
...
|
...
|
@@ -455,7 +455,7 @@ if (!function_exists('getImageUrl')) { |
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/20 16:46
|
|
|
|
*/
|
|
|
|
function getImageUrl($path,$storage_type = 0){
|
|
|
|
function getImageUrl($path,$storage_type = 0,$location = 1){
|
|
|
|
if(is_array($path)){
|
|
|
|
$url =[];
|
|
|
|
foreach ($path as $v){
|
|
...
|
...
|
@@ -471,12 +471,12 @@ if (!function_exists('getImageUrl')) { |
|
|
|
if(substr($path,0,2) == '//'){
|
|
|
|
return 'https:'.$path;
|
|
|
|
}
|
|
|
|
$imageModel = new Image();
|
|
|
|
$imageInfo = $imageModel->read(['path'=>$path],['is_cos']);
|
|
|
|
if($imageInfo === false){
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
if($imageInfo['is_cos'] == 1){
|
|
|
|
// $imageModel = new Image();
|
|
|
|
// $imageInfo = $imageModel->read(['path'=>$path],['is_cos']);
|
|
|
|
// if($imageInfo === false){
|
|
|
|
// return '';
|
|
|
|
// }
|
|
|
|
if($location == 1){
|
|
|
|
$cos = config('filesystems.disks.cos');
|
|
|
|
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
|
|
|
|
$url = $cosCdn.$path;
|
|
...
|
...
|
@@ -498,7 +498,7 @@ if (!function_exists('getFileUrl')) { |
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/20 16:46
|
|
|
|
*/
|
|
|
|
function getFileUrl($path,$storage_type = 0){
|
|
|
|
function getFileUrl($path,$storage_type = 0,$location = 1){
|
|
|
|
if(is_array($path)){
|
|
|
|
$url =[];
|
|
|
|
foreach ($path as $v){
|
...
|
...
|
|