update: config save

This commit is contained in:
tokumeikoi 2022-05-28 21:24:32 +08:00
parent 84f8089604
commit 5e7f782583

View File

@ -85,6 +85,7 @@ class ConfigController extends Controller
'commission_distribution_l3' => config('v2board.commission_distribution_l3')
],
'site' => [
'logo' => config('v2board.logo'),
'force_https' => (int)config('v2board.force_https', 0),
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),
'stop_register' => (int)config('v2board.stop_register', 0),
@ -172,7 +173,7 @@ class ConfigController extends Controller
$data = $request->validated();
$config = config('v2board');
foreach (ConfigSave::RULES as $k => $v) {
if (!in_array($k, array_keys(ConfigSave::RULES))) {
if (!in_array($k, array_keys(ConfigSave::RULES)) || !isset($data[$k])) {
unset($config[$k]);
continue;
}