Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
seeta-device
/
deviceManage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 12a16596
authored
Nov 19, 2021
by
谢林威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 不可删除自己账号
1 parent
2ba2c875
Pipeline
#6051
passed
in 2 minutes 19 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
src/views/Account/index.vue
src/views/Account/index.vue
View file @
12a1659
...
...
@@ -87,10 +87,10 @@
<st-form-item
v-if=
"submitType === 'create'"
:label=
"'重复密码:'"
prop=
"confirmPwd"
>
<st-input
v-model=
"form.confirmPwd"
type=
"password"
></st-input>
</st-form-item>
<st-form-item
v-if=
"submitType === 'edit'"
:label=
"'原密码:'"
prop=
"password
d
"
>
<st-form-item
v-if=
"submitType === 'edit'"
:label=
"'原密码:'"
prop=
"password"
>
<st-input
v-model=
"form.password"
type=
"password"
></st-input>
</st-form-item>
<st-form-item
v-if=
"submitType === 'edit'"
:label=
"'新密码:'"
prop=
"new_password
d
"
>
<st-form-item
v-if=
"submitType === 'edit'"
:label=
"'新密码:'"
prop=
"new_password"
>
<st-input
v-model=
"form.new_password"
type=
"password"
></st-input>
</st-form-item>
<st-form-item
...
...
@@ -192,7 +192,7 @@ export default {
username
:
[{
required
:
true
,
message
:
'请输入账号'
,
trigger
:
'blur'
}],
nickname
:
[{
required
:
true
,
message
:
'请输入昵称'
,
trigger
:
'blur'
}],
role
:
[{
required
:
true
,
message
:
'请选择角色'
,
trigger
:
'change'
}],
email
:
[{
required
:
true
,
message
:
'请
选择邮箱'
,
trigger
:
'change
'
}],
email
:
[{
required
:
true
,
message
:
'请
输入邮箱'
,
trigger
:
'blur
'
}],
passwd
:
[{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
}],
confirmPwd
:
[
{
required
:
true
,
message
:
'请确认密码'
,
trigger
:
'blur'
},
...
...
@@ -230,6 +230,7 @@ export default {
submitForm
.
creater
=
browserStorage
.
getItem
(
'username'
)
res
=
await
createUser
(
submitForm
)
if
(
res
&&
res
.
data
&&
res
.
data
.
code
===
0
)
{
Toast
.
success
(
'操作成功'
)
this
.
getData
()
}
this
.
showDialog
=
false
...
...
@@ -239,6 +240,7 @@ export default {
submitForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
))
res
=
await
editUser
(
submitForm
)
if
(
res
&&
res
.
data
&&
res
.
data
.
code
===
0
)
{
Toast
.
success
(
'操作成功'
)
this
.
getData
()
}
this
.
showDialog
=
false
...
...
@@ -266,7 +268,10 @@ export default {
async
handleDelete
(
row
)
{
const
confirmDelete
=
await
Dialog
.
confirm
(
'提示'
,
{
message
:
'是否删除此账号?'
})
if
(
!
confirmDelete
)
return
if
(
row
.
username
===
browserStorage
.
getItem
(
'username'
))
{
Toast
.
warning
(
'不可删除自己的账号'
)
return
}
const
res
=
await
deleteUser
({
username
:
row
.
username
})
if
(
res
)
{
Toast
.
success
(
'操作成功'
)
...
...
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