unknown 2 年之前
父節點
當前提交
3c9e55bd05
共有 3 個文件被更改,包括 2 次插入1 次删除
  1. 二進制
      audios/6270fce097abc354984962b7/1651573761audio.mp3
  2. 二進制
      audios/6270fce097abc354984962b7/1651574224audio.mp3
  3. 2 1
      controllers/messages.js

二進制
audios/6270fce097abc354984962b7/1651573761audio.mp3


二進制
audios/6270fce097abc354984962b7/1651574224audio.mp3


+ 2 - 1
controllers/messages.js

@@ -256,11 +256,12 @@ const audioMessage = async (req, res, next) => {
 		const isChat = await ChatModel.getByField(id, userId);
 		const isCompanionChat = await ChatModel.getByField(userId, id);
 		const originalName = req.file.originalname;
+		const fileName = req.file.fileName;
 		const newNameAudio = `${Math.round(Date.now() / 1000)}${originalName}`;
 		const fullType = req.file.mimetype;
 		await createFolderIsExist(path.join(DIR_AUDIOS, userId));
 		await fs.rename(
-			path.join(DIR_UPLOAD, originalName),
+			path.join(DIR_UPLOAD, fileName),
 			path.join(DIR_AUDIOS, userId, newNameAudio)
 		);
 		const audioUrl = path.normalize(path.join(userId, newNameAudio));