解决lsky pro图床反代/套CDN后无法加载静态文件(css, js),接口等问题

反代/套CDN后无法加载静态文件(css, js),安装时点击无反应

158046958-6477ea6c-d143-48df-92a0-550bae1aaff1.png

编辑 .env 文件,追加一行:

ASSET_URL=https://你的域名

54894684.png

接口问题

但是接口域名还是 http 的,所以在这个文件的 boot 方法里, lsky-pro/app/Providers/AppServiceProvider.php

 public function boot() 
 { 
 \Illuminate\Support\Facades\URL::forceScheme('https');
     // 是否需要生成 env 文件 
     if (! file_exists(base_path('.env'))) { 
         file_put_contents(base_path('.env'), file_get_contents(base_path('.env.example'))); 
         // 生成 key 
         Artisan::call('key:generate'); 
     } 
  
     // 如果已经安装程序,初始化一些配置 
     if (file_exists(base_path('installed.lock'))) { 
         // 覆盖默认配置 
         Config::set('app.name', Utils::config(ConfigKey::AppName)); 
         Config::set('mail', array_merge(\config('mail'), Utils::config(ConfigKey::Mail)->toArray())); 
  
         View::composer('*', function (\Illuminate\View\View $view) { 
             /** @var Group $group */ 
             $group = Auth::check() ? Auth::user()->group : Group::query()->where('is_guest', true)->first(); 
             $view->with('_group', $group); 
         }); 
     } 
 } 

第 32 行下面追加一行: \Illuminate\Support\Facades\URL::forceScheme('https');