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 801d8a32
authored
Nov 19, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
日志格式
1 parent
2cc44142
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
12 deletions
mixin/click.js
utils/logger/LogCat.js
utils/recordManager/interruptRecord.js
mixin/click.js
View file @
801d8a3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-11-1
8 11:21:51
* @LastEditTime: 2024-11-1
9 09:38:34
* @FilePath: \gl_tape\mixin\click.js
* @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -148,12 +148,36 @@ export default {
...
@@ -148,12 +148,36 @@ export default {
* @param {string} newFileName 新的文件名
* @param {string} newFileName 新的文件名
*/
*/
RenameFile
(
oldFilePath
,
newFileName
)
{
RenameFile
(
oldFilePath
,
newFileName
)
{
plus
.
io
.
resolveLocalFileSystemURL
(
oldFilePath
,
entry
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
entry
.
getParent
(
_oldFile
=>
{
plus
.
io
.
resolveLocalFileSystemURL
(
entry
.
moveTo
(
_oldFile
,
'/'
+
newFileName
,
newFilePath
=>
{
oldFilePath
,
console
.
log
(
'newFilePath'
,
newFilePath
.
fullPath
)
entry
=>
{
})
console
.
log
(
111
)
})
entry
.
getParent
(
_oldFile
=>
{
console
.
log
(
222
)
entry
.
moveTo
(
_oldFile
,
'/'
+
newFileName
,
newFilePath
=>
{
resolve
()
uni
.
$logger
.
local
.
info
(
`文件重命名成功!
${
newFilePath
.
fullPath
}
`
)
// console.log('newFilePath', newFilePath.fullPath)
},
()
=>
{
reject
()
}
)
},
()
=>
{
reject
()
}
)
},
()
=>
{
reject
()
}
)
})
})
},
},
...
@@ -228,11 +252,16 @@ export default {
...
@@ -228,11 +252,16 @@ export default {
oldFilePath
=
getPreAudioList
[
i
]
oldFilePath
=
getPreAudioList
[
i
]
uni
.
$logger
.
local
.
info
(
`临时文件不存在,找到之前保存的文件
${
oldFilePath
}
`
)
uni
.
$logger
.
local
.
info
(
`临时文件不存在,找到之前保存的文件
${
oldFilePath
}
`
)
}
}
const
newFileName
=
String
(
phone
).
slice
(
-
4
)
+
'_'
+
oldFilePath
.
replace
(
/.+
\/(\d
+
\.
mp3
)
/
,
'$1'
)
let
newFileName
=
String
(
phone
).
slice
(
-
4
)
+
'_'
+
oldFilePath
.
replace
(
/.+
\/(\d
+
\.
mp3
)
/
,
'$1'
)
try
{
await
this
.
RenameFile
(
oldFilePath
,
newFileName
)
}
catch
{
uni
.
$logger
.
local
.
error
(
`
${
newFileName
}
文件重命名失败`
)
newFileName
=
oldFilePath
.
replace
(
/.+
\/(\d
+
\.
mp3
)
/
,
'$1'
)
}
const
newFilePath
=
oldFilePath
.
replace
(
/
(
.+
\/)(\d
+
\.
mp3
)
/
,
''
)
+
newFileName
const
newFilePath
=
oldFilePath
.
replace
(
/
(
.+
\/)(\d
+
\.
mp3
)
/
,
''
)
+
newFileName
const
path
=
await
utils
.
getFileSaveFolderOnClient
()
const
path
=
await
utils
.
getFileSaveFolderOnClient
()
recordUrlList
.
push
({
status
:
UPLOAD_STATUS
.
fail
,
file
:
path
+
newFilePath
})
recordUrlList
.
push
({
status
:
UPLOAD_STATUS
.
fail
,
file
:
path
+
newFilePath
})
this
.
RenameFile
(
oldFilePath
,
newFileName
)
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
recordUrlList
=
[]
recordUrlList
=
[]
...
...
utils/logger/LogCat.js
View file @
801d8a3
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-11-01 15:06:40
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-11-19 09:25:11
* @FilePath: \gl-tape\utils\logger\LogCat.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
getTime
}
from
'./util'
import
{
getTime
}
from
'./util'
import
{
serializeIfObject
}
from
'@/utils/utils.js'
class
LogCat
{
class
LogCat
{
main
=
plus
.
android
.
runtimeMainActivity
()
main
=
plus
.
android
.
runtimeMainActivity
()
File
=
plus
.
android
.
importClass
(
'java.io.File'
)
File
=
plus
.
android
.
importClass
(
'java.io.File'
)
...
@@ -26,6 +33,9 @@ class LogCat {
...
@@ -26,6 +33,9 @@ class LogCat {
//文件名
//文件名
let
fileName
=
this
.
LogPath
+
'/'
+
date
+
'.txt'
let
fileName
=
this
.
LogPath
+
'/'
+
date
+
'.txt'
//写入的内容
//写入的内容
if
(
typeof
msg
==
'object'
)
{
msg
=
JSON
.
stringify
(
msg
)
}
let
content
=
`
${
datetime
}
[
${
tag
}
] :
${
msg
}
\n`
let
content
=
`
${
datetime
}
[
${
tag
}
] :
${
msg
}
\n`
console
.
log
(
content
.
replace
(
/
\n
/g
,
''
))
console
.
log
(
content
.
replace
(
/
\n
/g
,
''
))
let
path
=
new
this
.
File
(
this
.
LogPath
)
let
path
=
new
this
.
File
(
this
.
LogPath
)
...
...
utils/recordManager/interruptRecord.js
View file @
801d8a3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-10-14 17:38:35
* @Date: 2024-10-14 17:38:35
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-11-1
8 11:31:35
* @LastEditTime: 2024-11-1
9 09:35:24
* @FilePath: \gl-tape\utils\recordManager\interruptRecord.js
* @FilePath: \gl-tape\utils\recordManager\interruptRecord.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -52,6 +52,7 @@ class InterruptRecord extends RecordManager {
...
@@ -52,6 +52,7 @@ class InterruptRecord extends RecordManager {
uni
.
$logger
.
local
.
info
(
`删除待提交的记录
${
id
}
`
)
uni
.
$logger
.
local
.
info
(
`删除待提交的记录
${
id
}
`
)
this
.
removeRecord
(
id
)
this
.
removeRecord
(
id
)
storageApi
.
setRecords
(
''
,
'preRecordId'
)
storageApi
.
setRecords
(
''
,
'preRecordId'
)
clearInterval
(
Interval
)
}
}
/**
/**
* 初始化保存记录
* 初始化保存记录
...
@@ -66,7 +67,6 @@ class InterruptRecord extends RecordManager {
...
@@ -66,7 +67,6 @@ class InterruptRecord extends RecordManager {
return
return
}
}
const
pathName
=
await
this
.
getAudioPathName
()
const
pathName
=
await
this
.
getAudioPathName
()
const
audioPath
=
await
this
.
getAudioPath
(
pathName
)
const
audioPath
=
await
this
.
getAudioPath
(
pathName
)
this
.
audioPath
=
audioPath
this
.
audioPath
=
audioPath
const
id
=
utils
.
uuid
()
const
id
=
utils
.
uuid
()
...
@@ -128,6 +128,7 @@ class InterruptRecord extends RecordManager {
...
@@ -128,6 +128,7 @@ class InterruptRecord extends RecordManager {
this
.
updateAudio
()
this
.
updateAudio
()
const
pathName
=
await
this
.
getAudioPathName
()
const
pathName
=
await
this
.
getAudioPathName
()
const
audioPath
=
await
this
.
getAudioPath
(
pathName
)
const
audioPath
=
await
this
.
getAudioPath
(
pathName
)
this
.
audioPath
=
audioPath
this
.
records
.
audioPath
.
push
(
audioPath
)
this
.
records
.
audioPath
.
push
(
audioPath
)
const
records
=
this
.
getPreRecord
()
const
records
=
this
.
getPreRecord
()
const
params
=
{
...
records
,
...
this
.
records
}
const
params
=
{
...
records
,
...
this
.
records
}
...
@@ -143,6 +144,7 @@ class InterruptRecord extends RecordManager {
...
@@ -143,6 +144,7 @@ class InterruptRecord extends RecordManager {
if
(
isRemoveId
)
{
if
(
isRemoveId
)
{
uni
.
$logger
.
local
.
info
(
`清除正在接待记录的id`
)
uni
.
$logger
.
local
.
info
(
`清除正在接待记录的id`
)
storageApi
.
setRecords
(
''
,
'preRecordId'
)
storageApi
.
setRecords
(
''
,
'preRecordId'
)
clearInterval
(
Interval
)
}
}
const
updateParams
=
{
...
this
.
records
,
...
params
}
const
updateParams
=
{
...
this
.
records
,
...
params
}
console
.
log
(
updateParams
,
'updateParams'
)
console
.
log
(
updateParams
,
'updateParams'
)
...
...
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