Browse Source

支持索引下载

visuddhinanda 2 years ago
parent
commit
edf26a4fb4
1 changed files with 8 additions and 3 deletions
  1. 8 3
      app/Http/Controllers/OfflineIndexController.php

+ 8 - 3
app/Http/Controllers/OfflineIndexController.php

@@ -17,11 +17,16 @@ class OfflineIndexController extends Controller
      *
      *
      * @return \Illuminate\Http\Response
      * @return \Illuminate\Http\Response
      */
      */
-    public function index()
+    public function index(Request $request)
     {
     {
         //
         //
-        if(RedisClusters::has('/offline/index')){
-            $fileInfo = RedisClusters::get('/offline/index');
+        $key = '/offline/index/wikipali-offline';
+        if($request->has('file')){
+            $key .= '-'.$request->get('file');
+        }
+
+        if(RedisClusters::has()){
+            $fileInfo = RedisClusters::get($key);
             foreach ($fileInfo as $key => $file) {
             foreach ($fileInfo as $key => $file) {
                 $zipFile = $file['filename'];
                 $zipFile = $file['filename'];
                 $bucket = config('mint.attachments.bucket_name.temporary');
                 $bucket = config('mint.attachments.bucket_name.temporary');