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": { "app": {
"key": "aliyun-ai", "key": "aliyun-ai",
"entry": "dist/app.js", "entry": "dist/app.js",
"type": "system-app" "type": "system-app",
"runtime": [
"server"
]
}, },
"files": [ "files": [
"dist" "dist"

View File

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