Commit a397fcf2 by liimin

删除上一个临时文件

1 parent f3f7b41e
......@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2025-01-02 18:49:17
* @LastEditors: limin
* @LastEditTime: 2025-01-20 16:26:08
* @LastEditTime: 2025-01-20 16:39:51
* @FilePath: \gl_tape\utils\recordManager\TempRecord.js
*/
import utils from '../utils'
......@@ -53,7 +53,7 @@ class TempRecord {
}
async save(record = this.record) {
try {
if(!record) throw new Error('记录对象为空')
if (!record) throw new Error('记录对象为空')
uni.$logger.local.info('〖接待记录Record〗 == 开始持久化记录 ==' + JSON.stringify(record))
this.clearLoopTimer()
await this.saveTempFile(record)
......@@ -127,6 +127,8 @@ class TempRecord {
uni.$logger.local.info('〖接待记录Record〗 == 保存上一个临时文件!')
//保存上一个临时文件
await this.saveLastAudio()
//删除上一个临时文件
await this.removeOldTempAudio()
//新增一个录音
await this.addNewAudio()
//更新临时录音文件
......@@ -136,7 +138,6 @@ class TempRecord {
}
async addNewAudio() {
await this.removeOldTempAudio()
const lastAudio = await helpler.getLatestAudioFilePath()
uni.$logger.local.info('〖接待记录Record〗 == 添加一个新的录音' + lastAudio)
this.record.tempFilePath = lastAudio
......@@ -149,7 +150,7 @@ class TempRecord {
uni.$logger.local.info('〖接待记录Record〗 == 删除上一个临时文件 -> ' + tempFilePath)
return this.removeFile(tempFilePath)
}
updatePath() {
const { id, tempFilePath, recordUrlList } = this.record
return this.updateRecord({ tempFilePath, recordUrlList }, { id })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!