diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 82d77e8c..ddb4d0c0 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -406,6 +406,10 @@ class BaseController { } } + public static function verifySwitch($name) { + myself()->_callServiceStatic('ServerSwitchService', 'verifySwitch', $name); + } + public function _mergeAlikeItemKey($items){ $hashItems = array(); foreach ($items as $item){ diff --git a/webapp/services/ServerSwitchService.php b/webapp/services/ServerSwitchService.php index 812f6a3e..74a65b4c 100644 --- a/webapp/services/ServerSwitchService.php +++ b/webapp/services/ServerSwitchService.php @@ -41,6 +41,14 @@ class ServerSwitchService { return false; } + public static function verifySwitch($name) { + if (self::getConfig()[$name] > 0){ + return; + } + myself()->_rspErr(1008, 'function is disabled'); + die(); + } + // private $switchConfig = null; // // private function initConfig(){