From 22dc6b50a0ea9c57e1dbf33a51499cfd909c9187 Mon Sep 17 00:00:00 2001 From: wangjunyue <984209872@qq.com> Date: Wed, 30 Oct 2024 09:39:25 +0800 Subject: [PATCH] fix: Modify code details --- app/service/app-center/aiChat.ts | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/service/app-center/aiChat.ts b/app/service/app-center/aiChat.ts index 88ecf50..6429037 100644 --- a/app/service/app-center/aiChat.ts +++ b/app/service/app-center/aiChat.ts @@ -227,7 +227,7 @@ export default class AiChat extends Service { async requestFileContentFromAi(file: any, chatConfig: ConfigModel) { const { ctx } = this; - const filename = Math.random().toString(36).substr(2) + new Date().getTime() + path.extname(file.filename).toLocaleLowerCase(); + const filename = Date.now() + path.extname(file.filename).toLowerCase(); const savePath = path.join(__dirname, filename); const writeStream = fs.createWriteStream(savePath); file.pipe(writeStream); diff --git a/package.json b/package.json index dc99f26..57c6f65 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "http-status-codes": "^2.2.0", "koa-connect": "^2.1.0", "moment": "^2.29.4", + "openai": "^4.68.4", "proxy-agent": "^5.0.0", "qs": "^6.10.1", "typescript": "^4.0.0",