|
|
|
@ -610,14 +610,19 @@ Class ApiController extends Controller {
@@ -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); |
|
|
|
|