From 159e8722d73ec4f8d14b36232619dbd21e930dab Mon Sep 17 00:00:00 2001 From: tianya Date: Thu, 25 May 2023 21:27:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=B6=85=E6=97=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/api.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/admin/api.php b/src/admin/api.php index 3c23efcf..1864be78 100644 --- a/src/admin/api.php +++ b/src/admin/api.php @@ -243,8 +243,10 @@ if ($action === 'is_need_check_code') { $fileList = $dhd->GetJSON(); $dhd->Close(); $backupVerPath = $backupPath.'/'.$ver->ver; - RmRecurse($backupVerPath); - mkdir($backupVerPath); + if (!is_dir($backupVerPath)) { + @mkdir($backupVerPath); + } + $i = 0; foreach ($fileList as $f) { $realFile = $backupVerPath.$f->filename; //忽略src之外的目录 @@ -262,6 +264,17 @@ if ($action === 'is_need_check_code') { $f->filename = preg_replace('/^\/admin/', $curDir, $f->filename); @mkdir(dirname($realFile), 0777, true); file_put_contents($realFile, $fData); + $i++; + if ($i === 10) { + echo json_encode(array( + "code" => 0, + "msg" => "正在下载{$ver->ver}版本的{$f->filename}文件", + "data" => array( + "finish" => false, + ), + )); + exit; + } } $sqlUrl = DEDEBIZCDN.'/update/'.$ver->ver.'/update.sql'; $dhd = new DedeHttpDown();