|
@@ -322,8 +322,11 @@ class BookService
|
|
|
if (!$audio_effect_name) Utils::throwError('20003:请输入音频效果名称');
|
|
|
if (DB::table('mp_audio_effects')->where('audio_effect_name', $audio_effect_name)->exists()) Utils::throwError('20003:音效名称已存在');
|
|
|
|
|
|
- // 上传文件到oss
|
|
|
- $audio_effect_url = uploadFile('audio_effects', $file, $audio_effect_name);
|
|
|
+ // // 上传文件到oss
|
|
|
+ // $audio_effect_url = uploadFile('audio_effects', $file, $audio_effect_name);
|
|
|
+ // 上传文件到tos
|
|
|
+ $audio_effect_url = uploadFileByTos('effects', $file, $audio_effect_name);
|
|
|
+
|
|
|
if (!$audio_effect_url) Utils::throwError('20003:上传音频文件失败');
|
|
|
|
|
|
$boolen = DB::table('mp_audio_effects')->insert([
|
|
@@ -368,8 +371,11 @@ class BookService
|
|
|
if (!$audio_effect_name) Utils::throwError('20003:请输入音频效果名称');
|
|
|
if (DB::table('mp_audio_effects')->where('audio_effect_name', $audio_effect_name)->exists()) Utils::throwError('20003:音效名称已存在');
|
|
|
|
|
|
- // 上传文件到oss
|
|
|
- $audio_effect_url = uploadFile('audio_effects', $file, $audio_effect_name);
|
|
|
+ // // 上传文件到oss
|
|
|
+ // $audio_effect_url = uploadFile('audio_effects', $file, $audio_effect_name);
|
|
|
+ // 上传文件到tos
|
|
|
+ $audio_effect_url = uploadFileByTos('effects', $file, $audio_effect_name);
|
|
|
+
|
|
|
if (!$audio_effect_url) Utils::throwError('20003:上传音频文件失败');
|
|
|
$update_data['audio_effect_url'] = $audio_effect_url;
|
|
|
}
|
|
@@ -416,8 +422,10 @@ class BookService
|
|
|
if (!$bgm_name) Utils::throwError('20003:请输入音频效果名称');
|
|
|
if (DB::table('mp_bgms')->where('bgm_name', $bgm_name)->exists()) Utils::throwError('20003:bgm名称已存在');
|
|
|
|
|
|
- // 上传文件到oss
|
|
|
- $bgm_url = uploadFile('bgms', $file, $bgm_name);
|
|
|
+ // // 上传文件到oss
|
|
|
+ // $bgm_url = uploadFile('bgms', $file, $bgm_name);
|
|
|
+ // 上传文件到tos
|
|
|
+ $bgm_url = uploadFileByTos('bgm', $file, $bgm_name);
|
|
|
if (!$bgm_url) Utils::throwError('20003:上传音频文件失败');
|
|
|
|
|
|
$boolen = DB::table('mp_bgms')->insert([
|
|
@@ -461,8 +469,11 @@ class BookService
|
|
|
if (!$bgm_name) Utils::throwError('20003:请输入音频效果名称');
|
|
|
if (DB::table('mp_bgms')->where('bgm_name', $bgm_name)->exists()) Utils::throwError('20003:bgm名称已存在');
|
|
|
|
|
|
- // 上传文件到oss
|
|
|
- $bgm_url = uploadFile('bgms', $file, $bgm_name);
|
|
|
+ // // 上传文件到oss
|
|
|
+ // $bgm_url = uploadFile('bgms', $file, $bgm_name);
|
|
|
+ // 上传文件到tos
|
|
|
+ $bgm_url = uploadFileByTos('bgm', $file, $bgm_name);
|
|
|
+
|
|
|
if (!$bgm_url) Utils::throwError('20003:上传音频文件失败');
|
|
|
$update_data['bgm_url'] = $bgm_url;
|
|
|
}
|