diff --git a/app/Coding/Wiki.php b/app/Coding/Wiki.php index 395e640..90404cd 100644 --- a/app/Coding/Wiki.php +++ b/app/Coding/Wiki.php @@ -27,7 +27,7 @@ public function createWiki($token, $projectName, $data) public function createMarkdownZip($markdown, $path, $markdownFilename): bool|string { - $zipFileFullPath = sys_get_temp_dir() . '/' . $markdownFilename . '-' . Str::uuid() . '.zip'; + $zipFileFullPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $markdownFilename . '-' . Str::uuid() . '.zip'; if ($this->zipArchive->open($zipFileFullPath, ZipArchive::CREATE) !== true) { Log::error("cannot open <$zipFileFullPath>"); return false; @@ -39,11 +39,12 @@ public function createMarkdownZip($markdown, $path, $markdownFilename): bool|str // markdown image title:  $tmp = explode(' ', $attachment); $filename = $tmp[0]; - if (!file_exists($path . $filename)) { + $filepath = $path . DIRECTORY_SEPARATOR . $filename; + if (!file_exists($filepath)) { error_log("文件不存在:$filename"); continue; } - $this->zipArchive->addFile($path . $filename, $filename); + $this->zipArchive->addFile($filepath, $filename); } } $this->zipArchive->close(); diff --git a/app/Confluence.php b/app/Confluence.php index 0bacddd..fff12ee 100644 --- a/app/Confluence.php +++ b/app/Confluence.php @@ -40,6 +40,7 @@ public function htmlFile2Markdown(string $filename): string '||', '|