寻找文件并打开 lsky-pro/app/Providers/AppServiceProvider.php
寻找代码
public function boot()
{ 追加代码处
// 是否需要生成 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);
});
}
} 在追加代码处追加以下代码\Illuminate\Support\Facades\URL::forceScheme('https');
追加完成并保存文件后
使用ssl反向代理后
https可以完全加载静态资源