瀏覽代碼

技术资料附件接口优化

曹鹤洋 1 年之前
父節點
當前提交
6ddeb0fafd
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      application/api/controller/WorkOrder.php

+ 3 - 2
application/api/controller/WorkOrder.php

@@ -1690,14 +1690,15 @@ class WorkOrder extends Api
     {
         $fileName = '黄金叶(软大金圆)(二维码版)';
     $filePath = 'uploads/黄金叶(软大金圆)(二维码版).xlsx'; // Excel文件路径
-    $fileContent = base64_encode(file_get_contents($filePath));
+    $fileContent = file_get_contents($filePath);
 
+    return $fileContent;
     $this->success('成功',['fileName'=>$fileName,'data'=>$fileContent]);
     
     $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';
         $host = $_SERVER['HTTP_HOST'];
         $siteUrl = $protocol . '://' . $host .'/'.$filePath ;
-
+        
     $excelData = []; // 存储 Excel 数据的数组
 
     $reader = IOFactory::createReader('Xlsx'); // 创建Excel读取器