diff --git a/controller/ApiController.php b/controller/ApiController.php index 9e501f5..b234fbe 100644 --- a/controller/ApiController.php +++ b/controller/ApiController.php @@ -610,14 +610,19 @@ Class ApiController extends Controller { return ''; } - return strtolower(array_pop($arr)); + $suffix = array_pop($arr); + if (in_array($suffix, ['jpg', 'jpeg'])) { + $suffix = 'jpg'; + } + + return strtolower($suffix); } //从文件类型中解析文件后缀 protected function getSuffixFromFileType($fileType) { $arr = explode('/', $fileType); if (count($arr) < 2) { - return ''; + return $fileType; } $suffix = array_pop($arr);