update: config save

This commit is contained in:
tokumeikoi 2022-05-29 21:21:24 +08:00
parent 304e67a632
commit 6b978c421a
2 changed files with 2 additions and 8 deletions

View File

@ -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();
}
}
}

View File

@ -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];
}
}