作者 刘锟

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

1 <?php 1 <?php
2 2
3 use App\Models\File\Image; 3 use App\Models\File\Image;
4 -use App\Models\File\File; 4 +use App\Models\File\File as FileModel;
5 use App\Models\RouteMap\RouteMap; 5 use App\Models\RouteMap\RouteMap;
6 use App\Services\CosService; 6 use App\Services\CosService;
7 use App\Utils\EncryptUtils; 7 use App\Utils\EncryptUtils;
@@ -474,7 +474,7 @@ if (!function_exists('getImageUrl')) { @@ -474,7 +474,7 @@ if (!function_exists('getImageUrl')) {
474 return 'https:'.$path; 474 return 'https:'.$path;
475 } 475 }
476 $imageModel = new Image(); 476 $imageModel = new Image();
477 - $imageInfo = $imageModel->read(['path'=>$path],'is_cos'); 477 + $imageInfo = $imageModel->read(['path'=>$path],['is_cos']);
478 if($imageInfo === false){ 478 if($imageInfo === false){
479 return ''; 479 return '';
480 } 480 }
@@ -516,8 +516,8 @@ if (!function_exists('getFileUrl')) { @@ -516,8 +516,8 @@ if (!function_exists('getFileUrl')) {
516 if(substr($path,0,2) == '//'){ 516 if(substr($path,0,2) == '//'){
517 return 'https:'.$path; 517 return 'https:'.$path;
518 } 518 }
519 - $fileModel = new File();  
520 - $fileInfo = $fileModel->read(['path'=>$path],'is_cos'); 519 + $fileModel = new FileModel();
  520 + $fileInfo = $fileModel->read(['path'=>$path],['is_cos']);
521 if($fileInfo === false){ 521 if($fileInfo === false){
522 return ''; 522 return '';
523 } 523 }
@@ -51,10 +51,8 @@ class AmazonS3Service @@ -51,10 +51,8 @@ class AmazonS3Service
51 'SourceFile' => $body, 51 'SourceFile' => $body,
52 // 'ACL' => 'public-read', // 设置图片为公共可读,可根据需求修改 52 // 'ACL' => 'public-read', // 设置图片为公共可读,可根据需求修改
53 ]); 53 ]);
54 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('ok:'.$result['ObjectURL'], true) . PHP_EOL, FILE_APPEND);  
55 return $result['ObjectURL']; 54 return $result['ObjectURL'];
56 } catch (S3Exception $e) { 55 } catch (S3Exception $e) {
57 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('失败'.$e->getMessage(), true) . PHP_EOL, FILE_APPEND);  
58 return false; 56 return false;
59 } 57 }
60 } 58 }