Skip to content

Commit

Permalink
Merge pull request #6 from wilbur-yu/master
Browse files Browse the repository at this point in the history
适配hyperf2.2 上传
  • Loading branch information
lphkxd committed Sep 10, 2021
2 parents f2ab415 + 2273537 commit 11185ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Components/Form/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use HPlus\UI\Components\Component;
use HPlus\UI\Form;
use HPlus\UI\Form\FormItem;
use Hyperf\Filesystem\Version;

class Upload extends Component
{
Expand Down Expand Up @@ -69,9 +70,8 @@ public function destroy(FormItem $formItem)
}
if (!empty($file)){
$path = parse_url($file)['path'] ?? '';
if ($storage->has($path)) {
$storage->delete($path);
}
$action = Version::isV2() ? 'fileExists' : 'has';
$storage->{$action}($path) && $storage->delete($path);
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Widgets/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function make()

/**
* 设置 header
* @param string $header
* @param string|\Closure $header
* @return $this
*/
public function header($header)
Expand All @@ -39,7 +39,7 @@ public function header($header)

/**
* 设置 body 的样式
* @param string $bodyStyle
* @param string|array $bodyStyle
* @return $this
*/
public function bodyStyle($bodyStyle)
Expand Down

0 comments on commit 11185ae

Please sign in to comment.