|
|
@ -610,14 +610,19 @@ Class ApiController extends Controller { |
|
|
|
return ''; |
|
|
|
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) { |
|
|
|
protected function getSuffixFromFileType($fileType) { |
|
|
|
$arr = explode('/', $fileType); |
|
|
|
$arr = explode('/', $fileType); |
|
|
|
if (count($arr) < 2) { |
|
|
|
if (count($arr) < 2) { |
|
|
|
return ''; |
|
|
|
return $fileType; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$suffix = array_pop($arr); |
|
|
|
$suffix = array_pop($arr); |
|
|
|