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 38428392
authored
Nov 25, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
sentry优化
1 parent
471c5817
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
mixin/uploader.js
mixin/uploader.js
View file @
3842839
import
{
getOssToken
}
from
'@/utils/ossUploadFile/uploadFile.js'
import
Queue
from
'@/utils/Queue.js'
import
{
Command
}
from
'../ws/constants'
import
{
isInteger
}
from
'@/utils/utils.js'
import
{
isInteger
,
serializeIfObject
}
from
'@/utils/utils.js'
import
dayjs
from
'dayjs'
export
default
{
onLoad
()
{},
data
()
{
...
...
@@ -66,10 +67,27 @@ export default {
/**
* 上报文件上传失败日志
*/
reportError
(
recordId
,
filePath
,
res
,
message
=
'上传文件失败!!'
)
{
const
{
customerName
,
phoneNumber
,
carModel
,
salesName
}
=
uni
.
$recordManager
.
getRecordById
(
recordId
)
||
{}
// const { name } = uni.$storage.get('userInfo') || {}
uni
.
$logger
.
error
({
msg
:
message
,
extra
:
{
'手机号: '
:
phoneNumber
,
'姓名: '
:
customerName
,
'销售: '
:
salesName
,
'车型: '
:
carModel
,
'原因: '
:
JSON
.
stringify
(
res
),
'文件路径: '
:
filePath
}
})
async
reportError
(
recordId
,
filePath
,
res
,
message
=
'上传文件失败!!'
)
{
try
{
const
record
=
uni
.
$recordManager
.
getRecordById
(
recordId
)
||
{}
const
userInfo
=
uni
.
$storage
.
get
(
'userInfo'
)
const
{
customerName
,
phoneNumber
,
carModel
,
salesName
}
=
record
||
{}
const
{
name
}
=
userInfo
||
{}
const
now
=
dayjs
().
format
(
'YYYY-MM-DD HH:mm:ss'
)
uni
.
$logger
.
error
({
msg
:
`
${
now
}
-
${
message
}
,员工:
${
name
}
, 客户:
${
customerName
}
`
,
extra
:
{
'手机号: '
:
phoneNumber
,
'姓名: '
:
customerName
,
'销售: '
:
salesName
,
'车型: '
:
carModel
,
'原因: '
:
serializeIfObject
(
res
),
'文件路径: '
:
filePath
}
})
}
catch
(
error
)
{
uni
.
$logger
.
error
(
`报告错误时发生异常:
${
error
.
message
}
`
)
}
},
/**
* 初始化 WebView 的异步函数
...
...
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