作者 lyh

gx

@@ -8,6 +8,7 @@ use App\Http\Logic\Aside\Domain\DomainInfoLogic; @@ -8,6 +8,7 @@ use App\Http\Logic\Aside\Domain\DomainInfoLogic;
8 use App\Http\Requests\Aside\Domain\DomainInfoRequest; 8 use App\Http\Requests\Aside\Domain\DomainInfoRequest;
9 use App\Models\Aside\Domain\DomainInfo; 9 use App\Models\Aside\Domain\DomainInfo;
10 use Illuminate\Http\JsonResponse; 10 use Illuminate\Http\JsonResponse;
  11 +use Illuminate\Support\Facades\Storage;
11 use PhpOffice\PhpSpreadsheet\Spreadsheet; 12 use PhpOffice\PhpSpreadsheet\Spreadsheet;
12 use PhpOffice\PhpSpreadsheet\Writer\Xlsx; 13 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
13 14
@@ -170,12 +171,8 @@ class DomainInfoController extends BaseController @@ -170,12 +171,8 @@ class DomainInfoController extends BaseController
170 $filePath = public_path('upload/excel/'.time().'.xlsx'); 171 $filePath = public_path('upload/excel/'.time().'.xlsx');
171 // 导出 Excel 文件 172 // 导出 Excel 文件
172 $writer->save($filePath); 173 $writer->save($filePath);
173 - $header = [  
174 - 'Content-Description: File Transfer',  
175 - 'Content-Type: application/octet-stream'  
176 - ];  
177 // 返回导出文件的响应 174 // 返回导出文件的响应
178 - return response()->download($filePath,time().'.xlsx',$header)->deleteFileAfterSend(true); 175 + return Storage::disk('upload')->download($filePath);
179 } 176 }
180 177
181 } 178 }