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 获取导出信息