소스 검색

独立页

moshaorui 4 달 전
부모
커밋
8a6dc872f8
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      app/Admin/Forms/AppearanceImPortForm.php

+ 6 - 6
app/Admin/Forms/AppearanceImPortForm.php

@@ -98,14 +98,14 @@ class AppearanceImPortForm extends Form implements LazyRenderable
         }
         // 获取文件夹名称
         $folderName = reset($items);
-        $folderPath = $extractPath . '\\' . $folderName;
+        $folderPath = $extractPath . '/' . $folderName;
         // 获取文件夹下的所有文件和文件夹
         $folderContents = scandir($folderPath);
         $folderContents = array_diff($folderContents, ['.', '..']);
         // 将文件夹中的所有内容移动到 $trulyPath
         foreach ($folderContents as $fileOrDir) {
-            $sourcePath = $folderPath . '\\' . $fileOrDir;
-            $destinationPath = $trulyPath . '\\' . $fileOrDir;
+            $sourcePath = $folderPath . '/' . $fileOrDir;
+            $destinationPath = $trulyPath . '/' . $fileOrDir;
             // 如果是文件,移动文件
             if (is_file($sourcePath)) {
                 if (!rename($sourcePath, $destinationPath)) {
@@ -122,8 +122,8 @@ class AppearanceImPortForm extends Form implements LazyRenderable
                 $folderFiles = scandir($sourcePath);
                 $folderFiles = array_diff($folderFiles, ['.', '..']);
                 foreach ($folderFiles as $subFile) {
-                    $subSourcePath = $sourcePath . '\\' . $subFile;
-                    $subDestinationPath = $destinationPath . '\\' . $subFile;
+                    $subSourcePath = $sourcePath . '/' . $subFile;
+                    $subDestinationPath = $destinationPath . '/' . $subFile;
                     if (!rename($subSourcePath, $subDestinationPath)) {
                         return ['status' => false, 'error' => "Error: Failed to move subfolder file $subFile\n"];
                     }
@@ -146,7 +146,7 @@ class AppearanceImPortForm extends Form implements LazyRenderable
 
         // 循环遍历目录下的每一项
         foreach ($items as $item) {
-            $itemPath = $dir . '\\' . $item;
+            $itemPath = $dir . '/' . $item;
 
             // 如果是文件,删除文件
             if (is_file($itemPath)) {