From 6b978c421a8edca4a813cae661a948cfe0ebfd25 Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Sun, 29 May 2022 21:21:24 +0800 Subject: [PATCH] update: config save --- app/Console/Commands/Test.php | 6 ------ app/Http/Controllers/Admin/ConfigController.php | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index e0379a0a..d6fe0ffd 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -45,11 +45,5 @@ class Test extends Command */ public function handle() { - $users = User::all(); - foreach ($users as $user) { - $user->token = Helper::guid(); - $user->uuid = Helper::guid(true); - $user->save(); - } } } diff --git a/app/Http/Controllers/Admin/ConfigController.php b/app/Http/Controllers/Admin/ConfigController.php index 4fba1172..0c08bd01 100755 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -173,11 +173,11 @@ class ConfigController extends Controller $data = $request->validated(); $config = config('v2board'); foreach (ConfigSave::RULES as $k => $v) { - if (!in_array($k, array_keys(ConfigSave::RULES)) || !isset($data[$k])) { + if (!in_array($k, array_keys(ConfigSave::RULES))) { unset($config[$k]); continue; } - if (isset($data[$k])) { + if (isset($data[$k]) && !is_null($data[$k])) { $config[$k] = $data[$k]; } }