This commit is contained in:
熊潇 2025-07-01 19:02:15 +08:00
parent d96c342d3e
commit 3fe31039da
2 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,10 @@
"app": {
"key": "aliyun-ai",
"entry": "dist/app.js",
"type": "system-app"
"type": "system-app",
"runtime": [
"server"
]
},
"files": [
"dist"

View File

@ -47,10 +47,11 @@ app
const today = dayjs().format('YYYY-MM-DD');
// 使用用户名和日期作为文件夹路径
const filePath = `${username}/storage/aliyun-ai/audio/${today}/${fileName}`;
const result: Record<string, any> = {
audioUrl: url,
};
if (url) {
ctx.body = {
audioUrl: url,
};
ctx.body = result;
}
if (save === 'minio' && url) {
// 读取文件url地址的数据并保存到 MinIO, 文件是 音频 wave 格式
@ -64,8 +65,9 @@ app
share: 'public',
});
console.log('Audio file uploaded to MinIO:', filePath);
// @ts-ignore
ctx.body.minio = filePath;
result.minio = filePath;
result.filePath = `${username}/${filePath}`;
result.url = `${config.PROXY_DOMAIN || 'https://kevisual.cn'}/${result.filePath}`;
}
// 如果没有 url抛出错误
if (!url) {