接口更新

This commit is contained in:
2020-05-09 22:29:41 +08:00
parent dd64af9482
commit 6249dc9b5e
5 changed files with 116 additions and 6 deletions

View File

@@ -35,11 +35,31 @@ class Index extends Base {
*/
public function update(){
$version = new \com\Version();
$info = $version->check();
$this->data['info'] = $info;
return $this->fetch();
if($this->request->isPost()){
switch ($type) {
case 'down':
//下载升级包
$this->data['data'] = $version->downloadZip();
break;
case 'unzip':
//解压升级包
$this->data['data'] = $version->unzipFile();
case 'move':
//覆盖文件
case 'sql':
//升级数据库
default:
$this->data['data'] = "无操作";
break;
}
$this->data['code'] = 1;
return $this->data;
}else{
$info = $version->check();
$this->data['info'] = $info;
return $this->fetch();
}
}
/**