Browse Source

修复多后台不兼容路由缓存的问题

jqh 5 years ago
parent
commit
b9bf394d7c
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/Application.php

+ 5 - 3
src/Application.php

@@ -72,14 +72,16 @@ class Application
     {
         $this->registerRoute(static::DEFAULT);
 
-        if ($this->app->runningInConsole()) {
-            return;
-        }
         foreach ((array) config('admin.multi_app') as $app => $enable) {
             if ($enable) {
                 $this->registerRoute($app);
             }
         }
+
+        // 命令行重置多后台配置
+        if ($this->app->runningInConsole()) {
+            $this->withConfig(static::DEFAULT);
+        }
     }
 
     /**