🐛 修复 BUG

This commit is contained in:
Wisp X 2022-03-05 21:34:47 +08:00
parent 9c7920049f
commit 23678302ba
3 changed files with 5 additions and 10 deletions

View File

@ -54,7 +54,9 @@ class RegisteredUserController extends Controller
'password' => Hash::make($request->password),
]);
event(new Registered($user));
if (Utils::config(ConfigKey::IsUserNeedVerify)) {
event(new Registered($user));
}
Auth::login($user);

View File

@ -3,10 +3,8 @@
namespace App\Providers;
use App\Enums\ConfigKey;
use App\Enums\Mail\SmtpOption;
use App\Models\Group;
use App\Utils;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config;
@ -43,12 +41,7 @@ class AppServiceProvider extends ServiceProvider
if (file_exists(base_path('installed.lock'))) {
// 覆盖默认配置
Config::set('app.name', Utils::config(ConfigKey::AppName));
/** @var Collection $mailConfigs */
$mailConfigs = Utils::config(ConfigKey::Mail);
if ($mailConfigs->get(SmtpOption::Host)) {
Config::set('mail', array_merge(\config('mail'), $mailConfigs->toArray()));
}
Config::set('mail', array_merge(\config('mail'), Utils::config(ConfigKey::Mail)->toArray()));
$configs = Auth::check() && Auth::user()->group ?
Auth::user()->group->configs :

View File

@ -22,7 +22,7 @@ return [
ConfigKey::IsEnableApi => 1,
ConfigKey::IsAllowGuestUpload => 1,
ConfigKey::UserInitialCapacity => 512000,
ConfigKey::IsUserNeedVerify => 1,
ConfigKey::IsUserNeedVerify => 0,
ConfigKey::Mail => [
'default' => 'smtp',
'mailers' => [