Skip to content

Commit

Permalink
修复上传组件在 5.6 下兼容性问题
Browse files Browse the repository at this point in the history
  • Loading branch information
He110te4m committed Mar 22, 2018
1 parent b082a05 commit 9022036
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions despote/kernel/Upload.php
Expand Up @@ -22,7 +22,7 @@ class Upload extends Service
////////////////

// 上传文件保存的路径
protected $path = PATH_RES . "uploads/";
protected $path;
// 设置限制上传文件的类型
protected $allowType = ['jpg', 'gif', 'png', 'jpeg'];
// 限制文件上传大小(字节),默认为 10M
Expand All @@ -49,7 +49,7 @@ class Upload extends Service

protected function init()
{
empty($this->path) && $this->error('存储路径未设置');
empty($this->path) && $this->path = PATH_RES . 'uploads' . DS;
if (!is_dir($this->path) && !\Despote::file()->create($this->path, true)) {
$this->error('创建目录失败,请手动创建目录');
}
Expand Down

0 comments on commit 9022036

Please sign in to comment.