| 
...
 | 
...
 | 
@@ -141,33 +141,6 @@ public function uploadAmpVerifyFile(Request $request): string | 
| 
 | 
 | 
         return $this->success();
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     /**
 | 
| 
 | 
 | 
      * 压缩文件夹
 | 
| 
 | 
 | 
      */
 | 
| 
 | 
 | 
     public function createZipFile(){
 | 
| 
 | 
 | 
         $folderPath = public_path("target");
 | 
| 
 | 
 | 
         $zipFilePath = public_path().'/target.zip';
 | 
| 
 | 
 | 
         $zip = new ZipArchive();
 | 
| 
 | 
 | 
         if ($zip->open($zipFilePath, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) {
 | 
| 
 | 
 | 
             // 递归添加文件夹下的所有文件和子文件夹
 | 
| 
 | 
 | 
             $files = new RecursiveIteratorIterator(
 | 
| 
 | 
 | 
                 new RecursiveDirectoryIterator($folderPath),
 | 
| 
 | 
 | 
                 RecursiveIteratorIterator::LEAVES_ONLY
 | 
| 
 | 
 | 
             );
 | 
| 
 | 
 | 
             foreach ($files as $name => $file) {
 | 
| 
 | 
 | 
                 if (!$file->isDir()) {
 | 
| 
 | 
 | 
                     $filePath = $file->getRealPath();
 | 
| 
 | 
 | 
                     $relativePath = substr($filePath, strlen($folderPath) + 1);
 | 
| 
 | 
 | 
                     $zip->addFile($filePath, $relativePath);
 | 
| 
 | 
 | 
                 }
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             $zip->close();
 | 
| 
 | 
 | 
             echo '文件夹压缩成功';
 | 
| 
 | 
 | 
         } else {
 | 
| 
 | 
 | 
             echo '无法打开或创建压缩文件';
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     /**
 | 
| 
 | 
 | 
      * 获取需要下载的文件url
 | 
| 
...
 | 
...
 | 
@@ -181,6 +154,8 @@ public function websiteHtml(Request $request){ | 
| 
 | 
 | 
         $token = env("WEB_SITE_TOKEN");
 | 
| 
 | 
 | 
         $apiUrl = env("API_URL");
 | 
| 
 | 
 | 
         $requestUrl = $apiUrl."?domain=".$domain."&token=".$token;
 | 
| 
 | 
 | 
         @file_put_contents(storage_path('logs/notify_get_url.log'), date('Y-m-d H:i:s') . "接收到通知:". $requestUrl . PHP_EOL, FILE_APPEND);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         try {
 | 
| 
 | 
 | 
             $res = $this->curlGet($requestUrl);
 | 
| 
...
 | 
...
 | 
@@ -192,16 +167,16 @@ public function websiteHtml(Request $request){ | 
| 
 | 
 | 
         } catch (\Exception $e) {
 | 
| 
 | 
 | 
             return $this->error($e->getMessage());
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
         return $this->websiteHtmlHandle($url);
 | 
| 
 | 
 | 
         return $this->websiteHtmlHandle($url,$domain);
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     /**
 | 
| 
 | 
 | 
 /**
 | 
| 
 | 
 | 
  * 网站html解压
 | 
| 
 | 
 | 
  * @param $url
 | 
| 
 | 
 | 
  * @return string
 | 
| 
 | 
 | 
  */
 | 
| 
 | 
 | 
     public function websiteHtmlHandle($url)
 | 
| 
 | 
 | 
     {
 | 
| 
 | 
 | 
 public function websiteHtmlHandle($url,$domain)
 | 
| 
 | 
 | 
 {
 | 
| 
 | 
 | 
     $pathInfo = pathinfo($url);
 | 
| 
 | 
 | 
     $extension = $pathInfo['extension'];
 | 
| 
 | 
 | 
     //只允许解压zip格式文件
 | 
| 
...
 | 
...
 | 
@@ -210,7 +185,7 @@ public function websiteHtmlHandle($url) | 
| 
 | 
 | 
             $targetFile = $this->downLoadFile($url);
 | 
| 
 | 
 | 
             $zip = new ZipArchive();
 | 
| 
 | 
 | 
             if ($zip->open($targetFile) === TRUE) {
 | 
| 
 | 
 | 
                     $outputFolder = public_path();
 | 
| 
 | 
 | 
                 $outputFolder = public_path($domain);
 | 
| 
 | 
 | 
                 if (!is_dir($outputFolder)) {
 | 
| 
 | 
 | 
                     mkdir($outputFolder, 0777, true);
 | 
| 
 | 
 | 
                 }
 | 
| 
...
 | 
...
 | 
@@ -229,7 +204,7 @@ public function websiteHtmlHandle($url) | 
| 
 | 
 | 
         return $this->error('不允许解压改格式压缩包!');
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
     return  $this->success();
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
 }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     /**
 | 
| 
 | 
 | 
      * 下载文件(下载到public目录下)
 | 
...
 | 
...
 | 
 |