From c221f0fe4a28d94dbe1a9114cb95ea2ad7dcb340 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Mon, 3 May 2021 14:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20form=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8F=AF=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/library/form/Form.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/extend/catcher/library/form/Form.php b/extend/catcher/library/form/Form.php index 600131c..dbe63d6 100644 --- a/extend/catcher/library/form/Form.php +++ b/extend/catcher/library/form/Form.php @@ -193,10 +193,10 @@ abstract class Form * @param string $value * @return mixed */ - public static function image(string $title, string $value = ''): Upload + public static function image(string $title, string $field = 'image', string $value = ''): Upload { - return self::uploadImage('image', $title, self::uploadImageUrl(), $value) - ->uploadName('image') + return self::uploadImage($field, $title, self::uploadImageUrl(), $value) + ->uploadName($field) ->data(['none' => '']) ->headers(self::authorization()); } @@ -209,10 +209,10 @@ abstract class Form * @param array $value * @return mixed */ - public static function images(string $title, array $value = []): Upload + public static function images(string $title, $field = 'images', array $value = []): Upload { - return self::uploadImages('image', $title, self::uploadImageUrl(), $value) - ->uploadName('image') + return self::uploadImages($field, $title, self::uploadImageUrl(), $value) + ->uploadName($field) ->data(['none' => '']) ->headers(self::authorization()); } @@ -225,10 +225,10 @@ abstract class Form * @param string $value * @return Upload */ - public static function file(string $title, string $value = ''): Upload + public static function file(string $title, $field = 'file', string $value = ''): Upload { - return self::uploadFile('file', $title, self::uploadFileUrl(), $value) - ->uploadName('image') + return self::uploadFile($field, $title, self::uploadFileUrl(), $value) + ->uploadName($field) ->data(['none' => '']) ->headers(self::authorization()); } @@ -241,10 +241,10 @@ abstract class Form * @param array $value * @return Upload */ - public static function files(string $title, array $value = []): Upload + public static function files(string $title, $field = 'files',array $value = []): Upload { - return self::uploadFiles('file', $title, self::uploadFileUrl(), $value) - ->uploadName('file') + return self::uploadFiles($field, $title, self::uploadFileUrl(), $value) + ->uploadName($field) ->data(['none' => '']) ->headers(self::authorization()); }