Browse Source

fix: https问题

大侠咬超人 4 days ago
parent
commit
2417e06ec8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Providers/AppServiceProvider.php

+ 2 - 1
app/Providers/AppServiceProvider.php

@@ -39,7 +39,8 @@ class AppServiceProvider extends ServiceProvider
      */
     public function boot(): void
     {
-        if (config('app.env') === 'production') {
+        // 只有当 APP_URL 是 https 时才强制 https(容器内部通信用 http)
+        if (config('app.env') === 'production' && str_starts_with(config('app.url'), 'https://')) {
             URL::forceScheme('https');
         }