Explorar el Código

fix: https问题

大侠咬超人 hace 1 mes
padre
commit
2417e06ec8
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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');
         }