From 6cfb34ed71d9d656000a78f832a341177f979465 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Fri, 27 May 2022 18:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/Api.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/class/Api.php b/class/Api.php index ddb8b14..361b530 100755 --- a/class/Api.php +++ b/class/Api.php @@ -1462,7 +1462,7 @@ class Api { $this->return_json(-2000,'',"请求接口失败,请重试!"); } } catch (\Throwable $th) { - $this->return_json(-2000,'','网络请求失败!'); + $this->return_json(-2000,'','网络请求失败,请重试!'); } } /** @@ -1536,7 +1536,14 @@ class Api { $file_size = filesize("update.tar.gz"); //如果本地文件大小和远程文件大小不一致,则下载更新 if ( $file_size != $lentgh ) { - $this->down_updater(); + if ( $this->down_updater() ) { + //更新完毕后提示 + $this->return_json(200,"","更新程序准备就绪!"); + } + else{ + $this->return_json(-2000,"","更新程序下载失败,请检查目录权限!"); + } + } else { $this->return_json(200,"","更新程序准备就绪!"); @@ -1545,6 +1552,9 @@ class Api { else if( is_file("update.php") ) { $this->return_json(200,"","更新程序准备就绪!"); } + else{ + $this->return_json(200,"","更新程序准备就绪!"); + } } /** * 校验更新程序