fix
This commit is contained in:
parent
d96c342d3e
commit
3fe31039da
@ -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"
|
||||||
|
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user