|
...
|
...
|
@@ -10,7 +10,7 @@ use App\Models\Aside\Domain\DomainInfo; |
|
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
|
|
|
use Illuminate\Support\Facades\Response;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class DomainInfoController
|
|
...
|
...
|
@@ -170,9 +170,12 @@ class DomainInfoController extends BaseController |
|
|
|
$filePath = public_path('upload/excel/'.time().'.xlsx');
|
|
|
|
// 导出 Excel 文件
|
|
|
|
$writer->save($filePath);
|
|
|
|
$header = [
|
|
|
|
'Content-Description: File Transfer',
|
|
|
|
'Content-Type: application/octet-stream'
|
|
|
|
];
|
|
|
|
// 返回导出文件的响应
|
|
|
|
readfile($filePath);
|
|
|
|
exit();
|
|
|
|
return response()->download($filePath,time().'.xlsx',$header)->deleteFileAfterSend(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
...
|
...
|
|