Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
7d9480ac
Commit
7d9480ac
authored
Jun 05, 2025
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 重置密码
parent
79a8c23d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletions
+31
-1
src/views/system/UserPage.vue
+31
-1
No files found.
src/views/system/UserPage.vue
View file @
7d9480ac
...
...
@@ -119,6 +119,14 @@
>
<Edit
/>
</el-icon>
<el-icon
size=
"24"
title=
"重置密码"
color=
"#67C23A"
style=
"cursor: pointer; vertical-align: middle"
@
click
.
stop=
"resetPwd(scope.row)"
><RefreshLeft
/></el-icon>
</
template
>
</ElTableColumn>
</ElTable>
...
...
@@ -202,13 +210,14 @@ import {
deleteUserApi
,
getDetailsByIdApi
,
changeUserStatusApi
,
resetPasswordApi
,
}
from
'@/api/auth'
import
Icon
from
'@/components/Icon.vue'
import
{
UserEditForm
,
userData
,
userSearchForm
}
from
'@/types/api/user'
import
usePageList
from
'@/utils/hooks/usePageList'
import
{
useValue
}
from
'@/utils/hooks/useValue'
import
{
showConfirm
}
from
'@/utils/ui'
import
{
Edit
}
from
'@element-plus/icons-vue'
import
{
Edit
,
RefreshLeft
}
from
'@element-plus/icons-vue'
import
type
{
FormRules
}
from
'element-plus'
import
{
reactive
,
ref
}
from
'vue'
const
[
searchForm
,
resetSearchForm
]
=
useValue
<
userSearchForm
>
({})
...
...
@@ -347,6 +356,27 @@ const onChangeStatus = async (value: number, item: userData) => {
//showError(e)
}
}
const
resetPwd
=
async
(
row
:
userData
)
=>
{
try
{
await
showConfirm
(
`确认要重置用户
${
row
.
account
}
的密码?`
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
})
}
catch
{
return
}
try
{
const
res
=
await
resetPasswordApi
(
row
.
id
)
await
ElMessageBox
.
alert
(
'重置成功
\
n
\
r 新密码为:'
+
res
.
data
.
passWord
,
{
confirmButtonText
:
'确定'
,
type
:
'warning'
,
})
search
()
}
catch
(
e
)
{
search
()
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
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