Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7d1d87a1
authored
Mar 21, 2023
by
dtsz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
错误日志重构
parent
812300cc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
78 deletions
+78
-78
src/api/infra/apiErrorLog/index.ts
+2
-2
src/views/infra/apiErrorLog/apiErrorLog.data.ts
+0
-76
src/views/infra/apiErrorLog/detail.vue
+76
-0
src/views/infra/apiErrorLog/index.vue
+0
-0
No files found.
src/api/infra/apiErrorLog/index.ts
View file @
7d1d87a1
...
...
@@ -46,7 +46,7 @@ export interface ApiErrorLogExportReqVO {
}
// 查询列表API 访问日志
export
const
getApiErrorLogPageApi
=
(
params
:
ApiErrorLogPageReqVO
)
=>
{
export
const
getApiErrorLogPageApi
=
(
params
:
PageParam
)
=>
{
return
request
.
get
({
url
:
'/infra/api-error-log/page'
,
params
})
}
...
...
@@ -58,7 +58,7 @@ export const updateApiErrorLogPageApi = (id: number, processStatus: number) => {
}
// 导出API 访问日志
export
const
exportApiErrorLogApi
=
(
params
:
ApiErrorLogExportReqVO
)
=>
{
export
const
exportApiErrorLogApi
=
(
params
)
=>
{
return
request
.
download
({
url
:
'/infra/api-error-log/export-excel'
,
params
...
...
src/views/infra/apiErrorLog/apiErrorLog.data.ts
deleted
100644 → 0
View file @
812300cc
import
type
{
VxeCrudSchema
}
from
'@/hooks/web/useVxeCrudSchemas'
// CrudSchema
const
crudSchemas
=
reactive
<
VxeCrudSchema
>
({
primaryKey
:
'id'
,
primaryType
:
'id'
,
primaryTitle
:
'日志编号'
,
action
:
true
,
actionWidth
:
'300'
,
columns
:
[
{
title
:
'链路追踪'
,
field
:
'traceId'
,
isTable
:
false
},
{
title
:
'用户编号'
,
field
:
'userId'
,
isSearch
:
true
},
{
title
:
'用户类型'
,
field
:
'userType'
,
dictType
:
DICT_TYPE
.
USER_TYPE
,
isSearch
:
true
},
{
title
:
'应用名'
,
field
:
'applicationName'
,
isSearch
:
true
},
{
title
:
'请求方法名'
,
field
:
'requestMethod'
},
{
title
:
'请求地址'
,
field
:
'requestUrl'
,
isSearch
:
true
},
{
title
:
'异常发生时间'
,
field
:
'exceptionTime'
,
formatter
:
'formatDate'
,
search
:
{
show
:
true
,
itemRender
:
{
name
:
'XDataTimePicker'
}
}
},
{
title
:
'异常名'
,
field
:
'exceptionName'
},
{
title
:
'处理状态'
,
field
:
'processStatus'
,
dictType
:
DICT_TYPE
.
INFRA_API_ERROR_LOG_PROCESS_STATUS
,
dictClass
:
'number'
,
isSearch
:
true
},
{
title
:
'处理人'
,
field
:
'processUserId'
,
isTable
:
false
},
{
title
:
'处理时间'
,
field
:
'processTime'
,
formatter
:
'formatDate'
,
isTable
:
false
}
]
})
export
const
{
allSchemas
}
=
useVxeCrudSchemas
(
crudSchemas
)
src/views/infra/apiErrorLog/detail.vue
0 → 100644
View file @
7d1d87a1
<
template
>
<Dialog
title=
"详情"
v-model=
"modelVisible"
:scroll=
"true"
:max-height=
"500"
width=
"800"
>
<el-descriptions
border
:column=
"1"
>
<el-descriptions-item
label=
"日志主键"
min-width=
"120"
>
{{
detailData
.
id
}}
</el-descriptions-item>
<el-descriptions-item
label=
"链路追踪"
>
{{
detailData
.
traceId
}}
</el-descriptions-item>
<el-descriptions-item
label=
"应用名"
>
{{
detailData
.
applicationName
}}
</el-descriptions-item>
<el-descriptions-item
label=
"用户信息"
>
{{
detailData
.
userId
}}
|
<dict-tag
:type=
"DICT_TYPE.USER_TYPE"
:value=
"detailData.userType"
/>
|
{{
detailData
.
userIp
}}
|
{{
detailData
.
userAgent
}}
</el-descriptions-item>
<el-descriptions-item
label=
"请求信息"
>
{{
detailData
.
requestMethod
}}
|
{{
detailData
.
requestUrl
}}
</el-descriptions-item>
<el-descriptions-item
label=
"请求参数"
>
{{
detailData
.
requestParams
}}
</el-descriptions-item>
<el-descriptions-item
label=
"异常时间"
>
{{
formatDate
(
detailData
.
exceptionTime
,
'YYYY-MM-DD HH:mm:ss'
)
}}
</el-descriptions-item>
<el-descriptions-item
label=
"异常名"
>
{{
detailData
.
exceptionName
}}
</el-descriptions-item>
<el-descriptions-item
label=
"异常名"
v-if=
"detailData.exceptionStackTrace"
>
<el-input
type=
"textarea"
:readonly=
"true"
:autosize=
"
{ maxRows: 20 }"
v-model="detailData.exceptionStackTrace"
/>
</el-descriptions-item>
<el-descriptions-item
label=
"处理状态"
>
<dict-tag
:type=
"DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS"
:value=
"detailData.processStatus"
/>
</el-descriptions-item>
<el-descriptions-item
label=
"处理人"
v-if=
"detailData.processUserId"
>
{{
detailData
.
processUserId
}}
</el-descriptions-item>
<el-descriptions-item
label=
"处理时间"
v-if=
"detailData.processTime"
>
{{
formatDate
(
detailData
.
processTime
,
'YYYY-MM-DD HH:mm:ss'
)
}}
</el-descriptions-item>
</el-descriptions>
</Dialog>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
formatDate
}
from
'@/utils/formatTime'
import
*
as
ApiErrorLog
from
'@/api/infra/apiErrorLog'
const
modelVisible
=
ref
(
false
)
// 弹窗的是否展示
const
detailLoading
=
ref
(
false
)
// 表单的加载中
const
detailData
=
ref
()
// 详情数据
/** 打开弹窗 */
const
openModal
=
async
(
data
:
ApiErrorLog
.
ApiErrorLogVO
)
=>
{
modelVisible
.
value
=
true
// 设置数据
detailLoading
.
value
=
true
try
{
detailData
.
value
=
data
}
finally
{
detailLoading
.
value
=
false
}
}
defineExpose
({
openModal
})
// 提供 openModal 方法,用于打开弹窗
</
script
>
src/views/infra/apiErrorLog/index.vue
View file @
7d1d87a1
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment