fix
This commit is contained in:
		@@ -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}`;
 | 
				
			||||||
 | 
					    const result: Record<string, any> = {
 | 
				
			||||||
 | 
					      audioUrl: url,
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
    if (url) {
 | 
					    if (url) {
 | 
				
			||||||
      ctx.body = {
 | 
					      ctx.body = result;
 | 
				
			||||||
        audioUrl: url,
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    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) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user