Kaynağa Gözat

无法获取s3 时跳过

visuddhinanda 2 yıl önce
ebeveyn
işleme
4141628f7b

+ 9 - 2
app/Http/Controllers/OfflineIndexController.php

@@ -38,7 +38,7 @@ class OfflineIndexController extends Controller
                         $s3Link = Storage::temporaryUrl($zipFile, now()->addDays(1));
                     }catch(\Exception $e){
                         Log::error('offline-index {Exception}',['exception'=>$e]);
-                        return [];
+                        continue;
                     }
                 }
                 Log::info('offline-index: link='.$s3Link);
@@ -48,7 +48,14 @@ class OfflineIndexController extends Controller
                 ];
                 $fileInfo[$key]['url'] = $url;
             }
-            return $fileInfo;
+            return response()->json($fileInfo,
+                                    200,
+                                    [
+                                        'Content-Type' => 'application/json;charset=UTF-8',
+                                        'Charset' => 'utf-8'
+                                    ],
+                                    JSON_UNESCAPED_UNICODE
+                                );
         }else{
             return [];
         }