Просмотр исходного кода

add config attachments_bucket_name

visuddhinanda 2 лет назад
Родитель
Сommit
40d1239028

+ 1 - 1
app/Console/Commands/ExportZip.php

@@ -99,7 +99,7 @@ class ExportZip extends Command
         $this->info('upload file='.$zipFile);
         Log::debug('export offline: upload file {filename}',['filename'=>$zipFile]);
 
-        $bucket = 'attachments-'.config('app.env');
+        $bucket = config('mint.attachments_bucket_name');
         $tmpFile =  $bucket.'/'. $zipFile ;
         Storage::put($tmpFile, file_get_contents($zipFullFileName));
 

+ 1 - 1
app/Http/Controllers/OfflineIndexController.php

@@ -24,7 +24,7 @@ class OfflineIndexController extends Controller
             $fileInfo = RedisClusters::get('/offline/index');
             foreach ($fileInfo as $key => $file) {
                 $zipFile = $file['filename'];
-                $bucket = 'attachments-'.config('app.env');
+                $bucket = config('mint.attachments_bucket_name');
                 $tmpFile =  $bucket.'/'. $zipFile ;
                 $url = array();
                 foreach (config('mint.server.cdn_urls') as $key => $cdn) {

+ 4 - 0
config/mint.php

@@ -26,8 +26,12 @@ return [
         'dashboard_base_path' => env('DASHBOARD_BASE_PATH', "http://127.0.0.1:3000/my"),
 
         'cdn_urls' => explode(',',env('CDN_URLS', "https://www.wikipali.cc/downloads")),
+
+
     ],
 
+    'attachments_bucket_name' => env('ATTACHMENTS_BUCKET_NAME', "attachments_bucket"),
+
     'cache' => [
         //这个值prod,staging无需设置
         'expire' => env('CACHE_EXPIRE', 3600),