Browse Source

update: config save

tokumeikoi 2 years ago
parent
commit
6b978c421a
2 changed files with 2 additions and 8 deletions
  1. 0 6
      app/Console/Commands/Test.php
  2. 2 2
      app/Http/Controllers/Admin/ConfigController.php

+ 0 - 6
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();
-        }
     }
 }

+ 2 - 2
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];
             }
         }