diff --git a/src/helper/FormHelper.php b/src/helper/FormHelper.php index 625abdb..3cf8229 100644 --- a/src/helper/FormHelper.php +++ b/src/helper/FormHelper.php @@ -668,11 +668,13 @@ public static function editor($name = 'container', $type = 1, $options = [], $va */ public static function upload($name = 'avatar', $formData = '', $options = [], $value = '') { + $id = $name; if (!isset($options['type'])) $options['type'] = 'radio'; if (!isset($options['mime'])) $options['mime'] = 'image'; if (!isset($options['num'])) $options['num'] = 1; if (isset($options['num']) && $options['num'] == '*') $options['num'] = 100; if (!isset($options['path'])) $options['path'] = 'upload'; //上传路劲 + if (isset($options['id'])) $id = $options['id']; //ID $css = isset($options['css']) ? $options['css'] : 'display:inline-block;'; $label = $options['label'] ?? $name; $li = ''; @@ -686,7 +688,7 @@ public static function upload($name = 'avatar', $formData = '', $options = [], $ $crpperops = 'data-value="' . json_encode($cops, true) . '"'; $croper_container = ''; $options['num'] = 1;