Skip to content

Commit

Permalink
✨ Upload return image id. Closed #180
Browse files Browse the repository at this point in the history
  • Loading branch information
wisp-x committed Apr 16, 2021
1 parent 26840ed commit 1bbd06c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
...

### 🛠 安装要求
* PHP 版本 ≥ 5.6(≤ 7.3)
* PHP 版本 ≥ 5.6
* mysql 版本 ≥ 5.5
* PDO 拓展
* ZipArchive 支持
* fileinfo 拓展
* curl 拓展

注:推荐使用 PHP 7.3, 如果使用 FTP 功能,需要开启 PHP 的 FTP 拓展
注:如果使用 FTP 功能,需要开启 PHP 的 FTP 拓展

### 🔍 安装教程
1. 下载兰空,上传至 web 运行环境,解压。
Expand Down
4 changes: 2 additions & 2 deletions application/common/controller/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ public function exec()
$imageData['folder_id'] = $folderId;
}

if (!$img = Images::create($imageData)) {
if (!$model = Images::create($imageData)) {
$this->strategy->delete($pathname);
throw new Exception('图片数据保存失败');
}

$data = [
'id' => $img->id,
'id' => $model->id,
'name' => $image->getInfo('name'),
'url' => $url,
'size' => $size,
Expand Down

0 comments on commit 1bbd06c

Please sign in to comment.