From 68c1c3be99e3923b7936e5c64c8b147c5d5d4259 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 11 Oct 2023 17:37:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0iat=E8=AF=AD=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/XunFeiController.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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'];