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 6f9f6034
authored
Oct 14, 2024
by
yixinjj
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
获取日志添加消息回馈
1 parent
cc99bb22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
ws/workers/GetLogListWorker.js
ws/workers/LogsWorker.js
ws/workers/GetLogListWorker.js
View file @
6f9f603
import
{
serializeIfObject
}
from
'@/utils/utils.js'
export
default
class
GetLogListWorker
{
constructor
()
{}
work
(
deviceId
,
data
,
ws
)
{
...
...
ws/workers/LogsWorker.js
View file @
6f9f603
import
config
from
'@/config.js'
import
{
serializeIfObject
}
from
'@/utils/utils.js'
import
{
serializeIfObject
,
deepClone
}
from
'@/utils/utils.js'
export
default
class
LogsWorker
{
logFile
=
null
constructor
()
{
this
.
logFile
=
uni
.
$logger
.
local
.
logger
this
.
isUploading
=
false
this
.
files
=
[]
}
getLogFileList
()
{
return
this
.
logFile
.
getLogFileList
()
...
...
@@ -13,11 +14,12 @@ export default class LogsWorker {
if
(
this
.
isUploading
)
{
const
msg
=
`日志上传中,请稍后再试!`
uni
.
$logger
.
local
.
info
(
msg
)
//
this.ws.send(msg)
this
.
ws
.
send
(
msg
)
return
}
this
.
isUploading
=
true
const
files
=
this
.
getLogFileList
()
const
files
=
this
.
getLogFileList
()
this
.
files
=
JSON
.
stringify
(
files
)
if
(
files
?.
length
)
{
files
.
sort
((
a
,
b
)
=>
a
.
name
.
localeCompare
(
b
.
name
))
this
.
process
(
files
,
deviceId
)
...
...
@@ -29,7 +31,9 @@ export default class LogsWorker {
await
this
.
post
(
file
,
deviceId
)
setTimeout
(()
=>
this
.
process
(
files
,
deviceId
),
500
)
}
else
{
this
.
ws
.
send
({
code
:
200
,
msg
:
`日志上传完成 logs ->
${
this
.
files
}
`
})
this
.
isUploading
=
false
this
.
files
=
[]
}
}
post
({
name
,
path
},
deviceId
)
{
...
...
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