diff --git a/app/api/controller/XunFeiController.php b/app/api/controller/XunFeiController.php index 463647247..785b74adc 100644 --- a/app/api/controller/XunFeiController.php +++ b/app/api/controller/XunFeiController.php @@ -144,11 +144,8 @@ class XunFeiController extends BaseApiController if ($filesize > 1 * 1024 * 1024) { return $this->fail('录音文件太长'); } - $last_file_array = explode('/', $savename); - $n = count($last_file_array) - 1; - $last_file = $last_file_array[$n]; + $last_file = substr($savename, -36); $copyFile = app()->getRootPath() . '/public/uploads/iat/' . $last_file; - halt($file, $copyFile, $savename); copy($file, $copyFile); $ext = pathinfo($file, PATHINFO_EXTENSION); $extArray = ['mp3', 'pcm'];