Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a397fcf2
authored
Jan 20, 2025
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
删除上一个临时文件
1 parent
f3f7b41e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
utils/recordManager/TempRecord.js
utils/recordManager/TempRecord.js
View file @
a397fcf
...
...
@@ -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
})
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment