diff --git a/catch/.DS_Store b/catch/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/catch/.DS_Store and /dev/null differ diff --git a/catch/cms/controller/Form.php b/catch/cms/controller/Form.php deleted file mode 100644 index b3d9bbc..0000000 --- a/catch/cms/controller/Form.php +++ /dev/null @@ -1 +0,0 @@ -rule($this->fields()); - } - - /** - * form rule - * - * @time 2021年03月06日 - * @param array $rules - * @return array - */ - public function rule(array $rules): array - { - try { - return Elm::createForm('', $rules)->formRule(); - } catch (FormBuilderException $e) { - throw new FailedException('Form Created Failed: ' .$e->getMessage()); - } - } - - - /** - * 上传图片地址 - * - * @time 2021年03月03日 - * @return string - */ - protected function uploadImageUrl(): string - { - return env('app.domain') . '/cms/upload/image'; - } - - - /** - * 上传图片地址 - * - * @time 2021年03月03日 - * @return string - */ - protected function uploadFileUrl(): string - { - return env('app.domain') . '/cms/upload/file'; - } - - - protected function authorization(): array - { - return [ - 'authorization' => 'Bearer ' . request()->user()->remember_token, - ]; - } - - /** - * 上传图片 - * - * @time 2021年03月03日 - * @param $title - * @param string $value - * @return \FormBuilder\UI\Elm\Components\Upload - */ - public function image(string $title, string $value = ''): Upload - { - return self::uploadImage('image', $title, $this->uploadImageUrl(), $value) - ->uploadName('image') - ->data(['none' => '']) - ->headers($this->authorization()); - } - - /** - * 多图 - * - * @time 2021年03月03日 - * @param $title - * @param array $value - * @return \FormBuilder\UI\Elm\Components\Upload - */ - public function images(string $title, array $value = []): Upload - { - return self::uploadImages('image', $title, $this->uploadImageUrl(), $value) - ->uploadName('image') - ->data(['none' => '']) - ->headers($this->authorization()); - } -} diff --git a/catch/cms/form/FormFactory.php b/catch/cms/form/FormFactory.php deleted file mode 100644 index 389940e..0000000 --- a/catch/cms/form/FormFactory.php +++ /dev/null @@ -1,11 +0,0 @@ -