Commit 259a69b0 authored by lijiawei's avatar lijiawei

修复 在aws 环境中文件夹路径

parent efd6b78f
Pipeline #37105 failed with stages
...@@ -22,8 +22,7 @@ class Utils { ...@@ -22,8 +22,7 @@ class Utils {
}); });
// 保存的文件路径 // 保存的文件路径
const filePath = path.join( const filePath = path.join(
__dirname, `/tmp/${uuid()}.mp3`
`../download/${new Date().getTime()}.mp3`
); );
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -70,7 +69,7 @@ class Utils { ...@@ -70,7 +69,7 @@ class Utils {
}; };
// 获取需要上传的文件所在路径 // 获取需要上传的文件所在路径
const filePath = path.join(__dirname, "../upload", params.key); const filePath = path.join("/tmp", params.key);
if (!fs.existsSync(filePath)) { if (!fs.existsSync(filePath)) {
return reject({ code: 412 }); return reject({ code: 412 });
} }
...@@ -150,7 +149,7 @@ class Utils { ...@@ -150,7 +149,7 @@ class Utils {
// 新的音频文件名称 // 新的音频文件名称
filename = `${dateDir}/${uuid()}.mp3`, filename = `${dateDir}/${uuid()}.mp3`,
// 合并后的音频文件路径 // 合并后的音频文件路径
filePath = path.join(__dirname, "../upload", filename), filePath = path.join("/tmp", filename),
baseDir = path.dirname(filePath); baseDir = path.dirname(filePath);
// 如果文件夹不存在,则新创建文件夹 // 如果文件夹不存在,则新创建文件夹
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment