diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 63b2610ae..c247b869d 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -92,7 +92,6 @@ class Config extends Controller $this->error("后台入口名称{$xpath}已经存在应用!"); } SystemService::instance()->setRuntime([$xpath => 'admin']); - SystemService::instance()->bindRuntime(); } foreach ($this->request->post() as $name => $value) sysconf($name, $value); $this->success('修改系统参数成功!', sysuri("{$xpath}/index/index") . '#' . url("{$xpath}/config/index")); diff --git a/composer.lock b/composer.lock index 198a6fa45..fdcc96de6 100644 --- a/composer.lock +++ b/composer.lock @@ -909,12 +909,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e" + "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", - "reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/86bd9b95fc7080aa642c803446cde65acbaccedc", + "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc", "shasum": "", "mirrors": [ { @@ -958,7 +958,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2020-04-16T07:13:37+00:00" + "time": "2020-04-16T07:24:06+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index a8becb218..5557cfdb6 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -935,12 +935,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e" + "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", - "reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/86bd9b95fc7080aa642c803446cde65acbaccedc", + "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc", "shasum": "", "mirrors": [ { @@ -956,7 +956,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2020-04-16T07:13:37+00:00", + "time": "2020-04-16T07:24:06+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index e466a6adc..c4b4c4dad 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/service/SystemService.php b/vendor/zoujingli/think-library/src/service/SystemService.php index b4810819b..e7386d5d0 100644 --- a/vendor/zoujingli/think-library/src/service/SystemService.php +++ b/vendor/zoujingli/think-library/src/service/SystemService.php @@ -215,7 +215,6 @@ class SystemService extends Service * 设置实时运行配置 * @param array|null $map 应用映射 * @param string|null $run 支持模式 - * @return boolean */ public function setRuntime($map = [], $run = null) { @@ -226,7 +225,8 @@ class SystemService extends Service $file = "{$this->app->getRootPath()}runtime/config.json"; $data['app_run'] = is_null($run) ? $data['app_run'] : $run; $data['app_map'] = is_null($map) ? [] : array_merge($data['app_map'], $map); - return file_put_contents($file, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); + file_put_contents($file, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); + $this->bindRuntime($data); } /** @@ -246,11 +246,12 @@ class SystemService extends Service /** * 绑定应用实时配置 + * @param array $data 配置数据 */ - public function bindRuntime() + public function bindRuntime($data = []) { // 动态绑定应用映射 - $data = $this->getRuntime(); + if (empty($data)) $data = $this->getRuntime(); if (!empty($data['app_map'])) { $maps = $this->app->config->get('app.app_map', []); if (is_array($maps) && count($maps) > 0 && count($data['app_map']) > 0) {