前端组件调整,剔除无用文件

This commit is contained in:
2019-09-28 20:12:43 +08:00
parent 0b0d659c5e
commit c29b8358be
3496 changed files with 893 additions and 393801 deletions

View File

@@ -35,12 +35,27 @@ class Index extends Admin{
*/
public function clear(){
if ($this->request->isAjax()) {
# code...
}else{
return $this->data;
$root = app()->getRootPath() . 'runtime/';
$this->delDirAndFile($root);
return $this->success('更新成功!');
}
}
/** 递归删除文件
* @param $dirName
* @param bool $subdir
*/
protected function delDirAndFile($dirName)
{
$list = glob($dirName . '*');
foreach ($list as $file) {
if (is_dir($file))
$this->delDirAndFile($file . '/');
else
@unlink($file);
}
@rmdir($dirName);
}
/**
* @title 后台登录
*/