Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
fanxing_new
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5d12b743
authored
Jun 30, 2021
by
潘建波
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加用户锁定
1 parent
945cba1d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
src/api/ops/index.js
src/views/ops/user_manage.vue
src/api/ops/index.js
View file @
5d12b74
...
@@ -22,6 +22,9 @@ export default {
...
@@ -22,6 +22,9 @@ export default {
delUser
(
params
,
id
)
{
delUser
(
params
,
id
)
{
return
api
.
delete
(
`
${
baseUrl
}
/api/v1/auth/users/
${
id
}
`
,
params
);
return
api
.
delete
(
`
${
baseUrl
}
/api/v1/auth/users/
${
id
}
`
,
params
);
},
},
lockUser
(
userid
,
params
){
return
api
.
post
(
`
${
baseUrl
}
/api/v1/auth/users/
${
userid
}
`
,
params
);
},
addRole
(
params
)
{
addRole
(
params
)
{
return
api
.
post
(
`
${
baseUrl
}
/api/v1/auth/roles`
,
params
);
return
api
.
post
(
`
${
baseUrl
}
/api/v1/auth/roles`
,
params
);
},
},
...
...
src/views/ops/user_manage.vue
View file @
5d12b74
...
@@ -73,6 +73,18 @@
...
@@ -73,6 +73,18 @@
@
click=
"delFun(scope.$index, scope.row)"
@
click=
"delFun(scope.$index, scope.row)"
></span>
></span>
</el-tooltip>
</el-tooltip>
<span
class=
"tableSpanBorder"
></span>
<el-tooltip
content=
"锁定"
placement=
"bottom"
effect=
"light"
:visible-arrow=
"false"
>
<span
:class=
"
{'el-icon-lock editIcon':scope.row.lock,'el-icon-unlock delIcon':scope.row.lock==null||scope.row.lock}"
@click="clockuser(scope.$index, scope.row)"
>
</span>
</el-tooltip>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -332,6 +344,39 @@ export default {
...
@@ -332,6 +344,39 @@ export default {
});
});
});
});
},
},
clockuser
(
index
,
row
){
this
.
$confirm
(
"此操作将锁定该用户, 是否继续?"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
})
.
then
(()
=>
{
let
params
=
{
lock
:
row
.
lock
==
null
?
true
:
row
.
lock
}
this
.
$api
.
ops
.
lockUser
(
row
.
user_unid
,
params
).
then
(
res
=>
{
if
(
!
res
.
ecode
)
{
this
.
$message
({
type
:
"success"
,
message
:
params
.
lock
?
"锁定成功!"
:
"解锁成功!"
});
this
.
getTableList
();
this
.
$logs
.
oplogs
(
res
,
'serv_auth'
,
`删除用户
${
row
.
username
}
`
);
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
params
.
lock
?
"锁定失败!"
:
"解锁失败!"
});
}
});
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"info"
,
message
:
"已取消删除"
});
});
},
reset
(
index
,
row
)
{
reset
(
index
,
row
)
{
this
.
$confirm
(
"此操作将重置密码, 是否继续?"
,
"提示"
,
{
this
.
$confirm
(
"此操作将重置密码, 是否继续?"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
...
...
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