接口更新
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user