作者 刘锟

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

<?php
use App\Models\File\Image;
use App\Models\File\File;
use App\Models\File\File as FileModel;
use App\Models\RouteMap\RouteMap;
use App\Services\CosService;
use App\Utils\EncryptUtils;
... ... @@ -474,7 +474,7 @@ if (!function_exists('getImageUrl')) {
return 'https:'.$path;
}
$imageModel = new Image();
$imageInfo = $imageModel->read(['path'=>$path],'is_cos');
$imageInfo = $imageModel->read(['path'=>$path],['is_cos']);
if($imageInfo === false){
return '';
}
... ... @@ -516,8 +516,8 @@ if (!function_exists('getFileUrl')) {
if(substr($path,0,2) == '//'){
return 'https:'.$path;
}
$fileModel = new File();
$fileInfo = $fileModel->read(['path'=>$path],'is_cos');
$fileModel = new FileModel();
$fileInfo = $fileModel->read(['path'=>$path],['is_cos']);
if($fileInfo === false){
return '';
}
... ...
... ... @@ -51,10 +51,8 @@ class AmazonS3Service
'SourceFile' => $body,
// 'ACL' => 'public-read', // 设置图片为公共可读,可根据需求修改
]);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('ok:'.$result['ObjectURL'], true) . PHP_EOL, FILE_APPEND);
return $result['ObjectURL'];
} catch (S3Exception $e) {
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('失败'.$e->getMessage(), true) . PHP_EOL, FILE_APPEND);
return false;
}
}
... ...