diff --git a/conf/app.php b/conf/app.php index 1f72e60..e74847d 100644 --- a/conf/app.php +++ b/conf/app.php @@ -3,6 +3,7 @@ * Config */ $configs = array( + 'version' => '0.1.0', 'default_timezone' => 'Asia/Shanghai', //timezone //文档站皮肤 @@ -47,10 +48,10 @@ $configs = array( //目前支持的皮肤 'allowedThemes' => array( - 'manual', - 'webdirectory', - 'googleimage', - 'videoblog', + 'manual' => '文档站', + 'webdirectory' => '导航站', + 'googleimage' => '图片站', + 'videoblog' => '视频站', ), //md5加密前缀 diff --git a/controller/ApiController.php b/controller/ApiController.php index b234fbe..fb772e3 100644 --- a/controller/ApiController.php +++ b/controller/ApiController.php @@ -721,7 +721,7 @@ Class ApiController extends Controller { $themeName = $this->post('theme', ''); $contentDirectory = $this->post('contentdir', ''); - $allowedThemes = FSC::$app['config']['allowedThemes']; + $allowedThemes = array_keys( FSC::$app['config']['allowedThemes'] ); if (empty($themeName)) { $err = '参数不能为空!'; return $this->renderJson(compact('code', 'msg', 'err', 'data'), $this->httpStatus['notAllowed']); @@ -779,4 +779,26 @@ Class ApiController extends Controller { return $this->renderJson(compact('code', 'msg', 'err', 'data')); } + //config,获取系统配置信息 + public function actionConfig() { + $code = 0; + $msg = $err = ''; + $data = array(); + + $configs = FSC::$app['config']; + + $data['version'] = $configs['version']; + $data['supportedThemes'] = $configs['allowedThemes']; + $data['currentTheme'] = $configs['theme']; + $data['admin_captcha'] = $configs['admin']['captcha']; + $data['admin_maxUploadFileSize'] = $configs['admin']['maxUploadFileSize'] * 1024*1024; + $data['admin_supportedFileTypes'] = $configs['admin']['allowedUploadFileTypes']; + + $code = 1; + $msg = ''; + $err = ''; + + return $this->renderJson(compact('code', 'msg', 'err', 'data')); + } + }