wupengfei 2 years ago
parent
commit
7ac123c324
3 changed files with 6 additions and 5 deletions
  1. 2 1
      .idea/workspace.xml
  2. 1 1
      application/api/controller/Upload.php
  3. 3 3
      application/common.php

+ 2 - 1
.idea/workspace.xml

@@ -4,6 +4,7 @@
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Upload.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Upload.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -270,7 +271,7 @@
       <workItem from="1679532313623" duration="31448000" />
       <workItem from="1679619041819" duration="29965000" />
       <workItem from="1679706054685" duration="19035000" />
-      <workItem from="1679878121007" duration="12105000" />
+      <workItem from="1679878121007" duration="12168000" />
     </task>
     <servers />
   </component>

+ 1 - 1
application/api/controller/Upload.php

@@ -125,7 +125,7 @@ class Upload extends Base
         if (is_array($info) && isset($info['url'])) {
             $url = $this->safe ? $name : $info['url'];
             $pdf_url = pdfCurl($url);
-            var_dump($pdf_url);
+           // var_dump($pdf_url);
             $this->success('上传成功',['url'=>$url,'pdf_url'=>$pdf_url['data']]);
         } else {
             $this->error('文件处理失败,请稍候再试!');

+ 3 - 3
application/common.php

@@ -344,10 +344,10 @@ function pdfCurl($file_name)
     curl_setopt($ch, CURLOPT_URL, 'https://pdf.gyxqcdz.com/v1/pdf/upload');
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_POST, 1);
-    curl_setopt($ch, CURLOPT_POSTFIELDS, 'file=@'.$file_name);
+    //curl_setopt($ch, CURLOPT_POSTFIELDS, 'file=@'.$file_name);
    // var_dump( ['file'=>new \CURLFile(realpath($file_name))]);die();
-  //  curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile(realpath($file_name))]);
-   // curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>$file_name]);
+    //curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile(realpath($file_name))]);
+    curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile($file_name)]);
     $headers = array();
 
 //    $headers[] = 'Content-Type: application/x-www-form-urlencoded';