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
44819641
authored
Mar 23, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vue3 重构:REVIEW 登录日志
parent
8e032d98
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
26 deletions
+13
-26
src/api/system/loginLog/index.ts
+3
-9
src/styles/index.scss
+0
-6
src/views/system/loginlog/LoginLogDetail.vue
+3
-3
src/views/system/loginlog/index.vue
+7
-8
No files found.
src/api/system/loginLog/index.ts
View file @
44819641
...
...
@@ -13,18 +13,12 @@ export interface LoginLogVO {
createTime
:
Date
}
export
interface
LoginLogReqVO
extends
PageParam
{
userIp
?:
string
username
?:
string
status
?:
boolean
createTime
?:
Date
[]
}
// 查询登录日志列表
export
const
getLoginLogPage
=
(
params
:
LoginLogReqVO
)
=>
{
export
const
getLoginLogPage
=
(
params
:
PageParam
)
=>
{
return
request
.
get
({
url
:
'/system/login-log/page'
,
params
})
}
// 导出登录日志
export
const
exportLoginLog
=
(
params
:
LoginLogReqVO
)
=>
{
export
const
exportLoginLog
=
(
params
)
=>
{
return
request
.
download
({
url
:
'/system/login-log/export'
,
params
})
}
src/styles/index.scss
View file @
44819641
...
...
@@ -26,9 +26,3 @@
border-left-color
:
var
(
--
el-color-primary
);
}
}
// 添加表头样式
.el-table.yudao-table
{
--el-table-header-bg-color
:
#f8f8f9
;
--el-table-header-text-color
:
#606266
;
}
src/views/system/loginlog/
d
etail.vue
→
src/views/system/loginlog/
LoginLogD
etail.vue
View file @
44819641
<
template
>
<Dialog
title=
"详情"
v-model=
"modelVisible"
:scroll=
"true"
:max-height=
"500"
width=
"800"
>
<Dialog
title=
"详情"
v-model=
"modelVisible"
width=
"800"
>
<el-descriptions
border
:column=
"1"
>
<el-descriptions-item
label=
"日志编号"
min-width=
"120"
>
{{
detailData
.
id
}}
...
...
@@ -35,7 +35,7 @@ const detailLoading = ref(false) // 表单的加载中
const
detailData
=
ref
()
// 详情数据
/** 打开弹窗 */
const
open
Modal
=
async
(
data
:
LoginLogApi
.
LoginLogVO
)
=>
{
const
open
=
async
(
data
:
LoginLogApi
.
LoginLogVO
)
=>
{
modelVisible
.
value
=
true
// 设置数据
detailLoading
.
value
=
true
...
...
@@ -45,5 +45,5 @@ const openModal = async (data: LoginLogApi.LoginLogVO) => {
detailLoading
.
value
=
false
}
}
defineExpose
({
open
Modal
})
// 提供 openModal
方法,用于打开弹窗
defineExpose
({
open
})
// 提供 open
方法,用于打开弹窗
</
script
>
src/views/system/loginlog/index.vue
View file @
44819641
...
...
@@ -55,7 +55,7 @@
<!-- 列表 -->
<content-wrap>
<el-table
class=
"yudao-table"
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"日志编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"操作类型"
align=
"center"
prop=
"logType"
>
<template
#
default=
"scope"
>
...
...
@@ -64,7 +64,6 @@
</el-table-column>
<el-table-column
label=
"用户名称"
align=
"center"
prop=
"username"
width=
"180"
/>
<el-table-column
label=
"登录地址"
align=
"center"
prop=
"userIp"
width=
"180"
/>
<el-table-column
label=
"浏览器"
align=
"center"
prop=
"userAgent"
/>
<el-table-column
label=
"登陆结果"
align=
"center"
prop=
"result"
>
<
template
#
default=
"scope"
>
...
...
@@ -83,7 +82,7 @@
<el-button
link
type=
"primary"
@
click=
"open
Moda
l(scope.row)"
@
click=
"open
Detai
l(scope.row)"
v-hasPermi=
"['infra:config:query']"
>
详情
...
...
@@ -101,14 +100,14 @@
</content-wrap>
<!-- 表单弹窗:详情 -->
<
login-log-detail
ref=
"moda
lRef"
/>
<
LoginLogDetail
ref=
"detai
lRef"
/>
</template>
<
script
setup
lang=
"ts"
name=
"LoginLog"
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
download
from
'@/utils/download'
import
*
as
LoginLogApi
from
'@/api/system/loginLog'
import
LoginLogDetail
from
'./
d
etail.vue'
import
LoginLogDetail
from
'./
LoginLogD
etail.vue'
const
message
=
useMessage
()
// 消息弹窗
const
loading
=
ref
(
true
)
// 列表的加载中
...
...
@@ -149,9 +148,9 @@ const resetQuery = () => {
}
/** 详情操作 */
const
moda
lRef
=
ref
()
const
open
Moda
l
=
(
data
:
LoginLogApi
.
LoginLogVO
)
=>
{
modalRef
.
value
.
openModal
(
data
)
const
detai
lRef
=
ref
()
const
open
Detai
l
=
(
data
:
LoginLogApi
.
LoginLogVO
)
=>
{
detailRef
.
value
.
open
(
data
)
}
/** 导出按钮操作 */
...
...
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