fix
This commit is contained in:
		@@ -7,7 +7,10 @@
 | 
			
		||||
  "app": {
 | 
			
		||||
    "key": "aliyun-ai",
 | 
			
		||||
    "entry": "dist/app.js",
 | 
			
		||||
    "type": "system-app"
 | 
			
		||||
    "type": "system-app",
 | 
			
		||||
    "runtime": [
 | 
			
		||||
      "server"
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "files": [
 | 
			
		||||
    "dist"
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user