🐛 修复 BUG
This commit is contained in:
@@ -43,7 +43,7 @@ class GroupRequest extends FormRequest
|
||||
'exclude_if:configs.is_enable_scan,false',
|
||||
'in:mark,delete',
|
||||
],
|
||||
'configs.scan_configs.driver' => ['exclude_if:configs.is_enable_scan,false', 'in:aliyun',],
|
||||
'configs.scan_configs.driver' => ['exclude_if:configs.is_enable_scan,false', 'in:aliyun'],
|
||||
'configs.scan_configs.drivers.aliyun.access_key_id' => [$requiredIfReview('aliyun')],
|
||||
'configs.scan_configs.drivers.aliyun.access_key_secret' => [$requiredIfReview('aliyun')],
|
||||
'configs.scan_configs.drivers.aliyun.biz_type' => [$requiredIfReview('aliyun')],
|
||||
|
||||
+22
-1
@@ -151,7 +151,8 @@ class Utils
|
||||
*/
|
||||
public static function parseConfigs(array $defaults, array $configs): array
|
||||
{
|
||||
$array = array_replace_recursive($defaults, Utils::filter($configs));
|
||||
$configs = Utils::filter($configs);
|
||||
$array = self::array_merge_recursive_distinct($defaults, $configs);
|
||||
array_walk_recursive($array, function (&$item) {
|
||||
if (ctype_digit($item)) {
|
||||
$item += 0;
|
||||
@@ -162,4 +163,24 @@ class Utils
|
||||
});
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int|string, mixed> $array1
|
||||
* @param array<int|string, mixed> $array2
|
||||
*
|
||||
* @return array<int|string, mixed>
|
||||
*/
|
||||
private static function array_merge_recursive_distinct(array $array1, array &$array2): array
|
||||
{
|
||||
$merged = $array1;
|
||||
foreach ($array2 as $key => &$value) {
|
||||
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key]) && ! array_is_list($value)) {
|
||||
$merged[$key] = self::array_merge_recursive_distinct($merged[$key], $value);
|
||||
} else {
|
||||
$merged[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $merged;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="pb-6 h-full">
|
||||
<input type="file" id="picker" name="file" class="hidden" accept="image/*" multiple>
|
||||
<input type="file" id="picker" name="file" class="hidden" accept="{{ implode(',', array_map(fn ($ext) => '.'.$ext, $_group->configs->get(\App\Enums\GroupConfigKey::AcceptedFileSuffixes))) }}" multiple>
|
||||
|
||||
<div class="mb-4 p-4 bg-white rounded-md">
|
||||
<h1 class="tracking-wider text-2xl text-gray-700 mb-2" style="text-shadow: -4px 4px 0 rgb(0 0 0 / 10%);">Image Upload</h1>
|
||||
|
||||
Reference in New Issue
Block a user