Browse Source

优化

pull/81/head
xiaoz 3 years ago
parent
commit
6cfb34ed71
  1. 14
      class/Api.php

14
class/Api.php

@ -1462,7 +1462,7 @@ class Api {
$this->return_json(-2000,'',"请求接口失败,请重试!"); $this->return_json(-2000,'',"请求接口失败,请重试!");
} }
} catch (\Throwable $th) { } catch (\Throwable $th) {
$this->return_json(-2000,'','网络请求失败!'); $this->return_json(-2000,'','网络请求失败,请重试!');
} }
} }
/** /**
@ -1536,7 +1536,14 @@ class Api {
$file_size = filesize("update.tar.gz"); $file_size = filesize("update.tar.gz");
//如果本地文件大小和远程文件大小不一致,则下载更新 //如果本地文件大小和远程文件大小不一致,则下载更新
if ( $file_size != $lentgh ) { if ( $file_size != $lentgh ) {
$this->down_updater(); if ( $this->down_updater() ) {
//更新完毕后提示
$this->return_json(200,"","更新程序准备就绪!");
}
else{
$this->return_json(-2000,"","更新程序下载失败,请检查目录权限!");
}
} }
else { else {
$this->return_json(200,"","更新程序准备就绪!"); $this->return_json(200,"","更新程序准备就绪!");
@ -1545,6 +1552,9 @@ class Api {
else if( is_file("update.php") ) { else if( is_file("update.php") ) {
$this->return_json(200,"","更新程序准备就绪!"); $this->return_json(200,"","更新程序准备就绪!");
} }
else{
$this->return_json(200,"","更新程序准备就绪!");
}
} }
/** /**
* 校验更新程序 * 校验更新程序

Loading…
Cancel
Save