moshaorui 4 months ago
parent
commit
425f74b474
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/Distributor/bootstrap.php

+ 6 - 0
app/Distributor/bootstrap.php

@@ -28,6 +28,12 @@ use Dcat\Admin\Layout\Menu;
  * Admin::js('/packages/prettydocs/js/main.js');
  *
  */
+if (isset($_SERVER['ENV_FILE'])) {
+    $envPath = base_path($_SERVER['ENV_FILE']);
+    if (file_exists($envPath)) {
+        Dotenv::load($envPath);
+    }
+}
 
 // 设置后台布局
 $newContent = new Content();