Skip to content

Commit

Permalink
✨ 上传接口返回ID
Browse files Browse the repository at this point in the history
  • Loading branch information
wisp-x committed Nov 20, 2020
1 parent 97b2eaf commit b23fc23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/common/controller/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ public function exec()
$imageData['folder_id'] = $folderId;
}

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

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

0 comments on commit b23fc23

Please sign in to comment.