From caab0694445531e74056a6e954072d83fc602c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 3 Dec 2021 09:54:28 +0800 Subject: [PATCH] * add system mode for config. --- api/v1/entries/config.php | 3 +++ api/v1/entries/configs.php | 9 +++++---- framework/base/router.class.php | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/v1/entries/config.php b/api/v1/entries/config.php index 392188a061..5c370b8db5 100644 --- a/api/v1/entries/config.php +++ b/api/v1/entries/config.php @@ -36,6 +36,9 @@ class configEntry extends baseEntry case 'timezone': $config['value'] = $this->config->timezone; break; + case 'systemMode': + $config['value'] = $this->config->systemMode; + break; default: $this->sendError(400, 'No configuration.'); return; diff --git a/api/v1/entries/configs.php b/api/v1/entries/configs.php index 18982fbc08..917bef2aab 100644 --- a/api/v1/entries/configs.php +++ b/api/v1/entries/configs.php @@ -21,10 +21,11 @@ class configsEntry extends baseEntry { $configs = array(); - $configs[] = array('key' => 'language', 'value' => $this->config->default->lang); - $configs[] = array('key' => 'version', 'value' => $this->config->version); - $configs[] = array('key' => 'charset', 'value' => $this->config->charset); - $configs[] = array('key' => 'timezone', 'value' => $this->config->timezone); + $configs[] = array('key' => 'language', 'value' => $this->config->default->lang); + $configs[] = array('key' => 'version', 'value' => $this->config->version); + $configs[] = array('key' => 'charset', 'value' => $this->config->charset); + $configs[] = array('key' => 'timezone', 'value' => $this->config->timezone); + $configs[] = array('key' => 'systemMode', 'value' => $this->config->systemMode); $this->send(200, $configs); } diff --git a/framework/base/router.class.php b/framework/base/router.class.php index f0db46e652..f9d435ed41 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2118,6 +2118,7 @@ class baseRouter $view->methodVar = $this->config->methodVar; $view->viewVar = $this->config->viewVar; $view->sessionVar = $this->config->sessionVar; + $view->systemMode = $this->config->systemMode; $this->session->set('random', mt_rand(0, 10000)); $view->sessionName = session_name();