|
|
@ -9,6 +9,13 @@ require_once __DIR__ . '/SiteController.php'; |
|
|
|
Class ApiController extends SiteController { |
|
|
|
Class ApiController extends SiteController { |
|
|
|
|
|
|
|
|
|
|
|
public function actionIndex() { |
|
|
|
public function actionIndex() { |
|
|
|
|
|
|
|
$code = 0; |
|
|
|
|
|
|
|
$err = 'Not allowed'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->renderJson(compact('code', 'err')); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function actionTags() { |
|
|
|
//获取数据 |
|
|
|
//获取数据 |
|
|
|
$menus = array(); //菜单,一级目录 |
|
|
|
$menus = array(); //菜单,一级目录 |
|
|
|
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 |
|
|
|
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 |
|
|
@ -18,16 +25,15 @@ Class ApiController extends SiteController { |
|
|
|
$scanner = new DirScanner(); |
|
|
|
$scanner = new DirScanner(); |
|
|
|
$scanner->setWebRoot(FSC::$app['config']['content_directory']); |
|
|
|
$scanner->setWebRoot(FSC::$app['config']['content_directory']); |
|
|
|
$dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 3); |
|
|
|
$dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 3); |
|
|
|
//$scanResults = $scanner->getScanResults(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$code = 1; |
|
|
|
$code = 1; |
|
|
|
$msg = ''; |
|
|
|
$msg = ''; |
|
|
|
$err = ''; |
|
|
|
$err = ''; |
|
|
|
|
|
|
|
|
|
|
|
//获取tags分类 |
|
|
|
//获取tags分类 |
|
|
|
$data = $this->getTags($dirTree); |
|
|
|
$noFiles = true; |
|
|
|
|
|
|
|
$data = $this->getTags($dirTree, $noFiles); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->renderJson(compact('code', 'msg', 'err', 'data')); |
|
|
|
return $this->renderJson(compact('code', 'msg', 'err', 'data')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|