From 39d5c8b1976527547af241392376a0c3b1c56b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=86=89=E6=8C=BD=E6=B8=85=E9=A3=8E?= <1550969027@qq.com> Date: Wed, 8 Mar 2023 10:24:12 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=AF=BC=E5=87=BAexcel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/DownloadController.php | 2 +- app/common/lists/ListsExcelTrait.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/admin/controller/DownloadController.php b/app/admin/controller/DownloadController.php index 170e9e1..d369f07 100644 --- a/app/admin/controller/DownloadController.php +++ b/app/admin/controller/DownloadController.php @@ -33,6 +33,6 @@ class DownloadController extends BaseAdminController //下载前删除缓存 Cache::delete($fileKey); - return download($fileInfo['src'] . $fileInfo['name'], $fileInfo['name']); + return response()->download($fileInfo['src'] . $fileInfo['name'],$fileInfo['name']); } } \ No newline at end of file diff --git a/app/common/lists/ListsExcelTrait.php b/app/common/lists/ListsExcelTrait.php index a035249..1015091 100644 --- a/app/common/lists/ListsExcelTrait.php +++ b/app/common/lists/ListsExcelTrait.php @@ -92,8 +92,7 @@ trait ListsExcelTrait } $writer->save($src . $this->fileName); //设置本地excel缓存并返回下载地址 - $vars = ['file' => $exportCache->setFile($this->fileName)]; - return (string)(url('admin/download/export', $vars, true, true)); + return 'http://'.request()->host().'/admin/download/export?file='.$exportCache->setFile($this->fileName); } /** * @notes 获取导出信息