app)->buildFileList([ 'think', 'app/admin', 'public/static', ]); dump($modules); $this->success('获取当前文件列表成功!', $modules, [ 'public/static/self' ]); } /** * 读取线上文件数据 * @param string $encode */ public function get($encode) { $this->file = dirname($this->app->getAppPath()) . '/' . decode($encode); if (file_exists($this->file)) { $this->success('读取文件成功!', [ 'format' => 'base64', 'content' => base64_encode(file_get_contents($this->file)), ]); } else { $this->error('获取文件内容失败!'); } } }