作者 lyh

变更数据

@@ -232,7 +232,7 @@ class IndexController extends BaseController @@ -232,7 +232,7 @@ class IndexController extends BaseController
232 public function prInfoDownload() 232 public function prInfoDownload()
233 { 233 {
234 $url = 'http://crawl.scraper.waimaoq.com/export/issuewire?token=MT0CM7y4tdFTFTm'; 234 $url = 'http://crawl.scraper.waimaoq.com/export/issuewire?token=MT0CM7y4tdFTFTm';
235 - $response = Http::get($url,['page'=>$this->param['page'],'pagesize'=>$this->param['row']]); 235 + $response = Http::get($url,['page'=>$this->page,'pagesize'=>$this->row]);
236 if ($response->successful()) { 236 if ($response->successful()) {
237 $result = $response->json(); 237 $result = $response->json();
238 } 238 }
@@ -207,7 +207,10 @@ class ImageController extends Controller @@ -207,7 +207,10 @@ class ImageController extends Controller
207 if($this->upload_location == 0){ 207 if($this->upload_location == 0){
208 $watermarkOptions = $this->getProjectConfig($this->cache['project_id'] ?? 0); 208 $watermarkOptions = $this->getProjectConfig($this->cache['project_id'] ?? 0);
209 $cosService = new CosService(); 209 $cosService = new CosService();
210 - $cosService->uploadFile($files,$this->path,$fileName,false,$watermarkOptions); 210 + $res = $cosService->uploadFile($files,$this->path,$fileName,false,$watermarkOptions);
  211 + if($res === false){
  212 + $this->response('上传失败,请重新上传',Code::SYSTEM_ERROR);
  213 + }
211 }else{ 214 }else{
212 //TODO::上传亚马逊 215 //TODO::上传亚马逊
213 $amazonS3Service = new AmazonS3Service(); 216 $amazonS3Service = new AmazonS3Service();
@@ -48,6 +48,7 @@ class CosService @@ -48,6 +48,7 @@ class CosService
48 // 如果不是 Base64 流文件,处理为普通文件上传 48 // 如果不是 Base64 流文件,处理为普通文件上传
49 $Body = $binary ? $files : fopen($files->getRealPath(), 'r'); 49 $Body = $binary ? $files : fopen($files->getRealPath(), 'r');
50 } 50 }
  51 + try {
51 $options = [ 52 $options = [
52 'Bucket' => $cos['bucket'], 53 'Bucket' => $cos['bucket'],
53 'Key' => $key, 54 'Key' => $key,
@@ -66,6 +67,11 @@ class CosService @@ -66,6 +67,11 @@ class CosService
66 ], true); 67 ], true);
67 } 68 }
68 $res = $cosClient->putObject($options); 69 $res = $cosClient->putObject($options);
  70 + @file_put_contents(storage_path('logs/upload_images'), var_export($res, true) . PHP_EOL, FILE_APPEND);
  71 + }catch (\Exception $e){
  72 + @file_put_contents(storage_path('logs/upload_images'), var_export($e->getMessage(), true) . PHP_EOL, FILE_APPEND);
  73 + return false;
  74 + }
69 return $key; 75 return $key;
70 } 76 }
71 77