Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
ka-op-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
ka-op-ui
Commits
7c64a533
Commit
7c64a533
authored
Mar 12, 2020
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改密码
parent
aed862d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
5 deletions
+55
-5
userManager.js
src/api/userManager.js
+8
-0
manager.vue
src/views/user/manager.vue
+44
-4
roleManager.vue
src/views/user/roleManager.vue
+3
-1
No files found.
src/api/userManager.js
View file @
7c64a533
...
@@ -63,3 +63,11 @@ export function modifyRole(data) {
...
@@ -63,3 +63,11 @@ export function modifyRole(data) {
data
data
})
})
}
}
export
function
changePassword
(
data
)
{
return
request
({
url
:
'
/user/update/password
'
,
method
:
'
put
'
,
data
})
}
src/views/user/manager.vue
View file @
7c64a533
...
@@ -40,9 +40,10 @@
...
@@ -40,9 +40,10 @@
<el-table-column
label=
"更新时间"
prop=
"updateTime"
align=
"center"
/>
<el-table-column
label=
"更新时间"
prop=
"updateTime"
align=
"center"
/>
<el-table-column
label=
"登录时间"
prop=
"lastLoginTime"
align=
"center"
/>
<el-table-column
label=
"登录时间"
prop=
"lastLoginTime"
align=
"center"
/>
<el-table-column
label=
"操作"
align=
"center"
width=
"80"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"{row}"
>
<
template
slot-scope=
"{row}"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(row)"
>
编辑
</el-button>
<el-button
size=
"mini"
@
click=
"HandleChangePassword(row)"
>
修改密码
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -91,11 +92,28 @@
...
@@ -91,11 +92,28 @@
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogPassword"
>
<el-form
:model=
"temp"
label-position=
"left"
label-width=
"115px"
style=
"margin-left:10px;"
>
<el-form-item
label=
"登录账号"
prop=
"username"
>
<el-input
v-model=
"temp.username"
disabled
/>
</el-form-item>
<el-form-item
label=
"新密码"
prop=
"newPassword"
>
<el-input
v-model=
"temp.newPassword"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogPassword = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"changePassword()"
>
确定
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
fetchUser
,
fetchUserRank
,
save
,
modifyUser
,
getRoles
}
from
'
@/api/userManager
'
import
{
fetchUser
,
fetchUserRank
,
save
,
modifyUser
,
getRoles
,
changePassword
}
from
'
@/api/userManager
'
import
{
getChannelInfo
}
from
'
@/api/channel
'
import
{
getChannelInfo
}
from
'
@/api/channel
'
import
Pagination
from
'
@/components/Pagination
'
import
Pagination
from
'
@/components/Pagination
'
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
...
@@ -128,10 +146,12 @@ export default {
...
@@ -128,10 +146,12 @@ export default {
temp
:
{},
temp
:
{},
dialogFormVisible
:
false
,
dialogFormVisible
:
false
,
dialogDeleteVisible
:
false
,
dialogDeleteVisible
:
false
,
dialogPassword
:
false
,
dialogStatus
:
''
,
dialogStatus
:
''
,
textMap
:
{
textMap
:
{
update
:
'
Edit
'
,
update
:
'
Edit
'
,
create
:
'
Create
'
create
:
'
Create
'
,
modify
:
'
Modify
'
},
},
users
:
[],
users
:
[],
channels
:
[],
channels
:
[],
...
@@ -193,6 +213,7 @@ export default {
...
@@ -193,6 +213,7 @@ export default {
handleCreate
()
{
handleCreate
()
{
this
.
temp
=
{
this
.
temp
=
{
status
:
'
ENABLED
'
}
}
this
.
dialogStatus
=
'
create
'
this
.
dialogStatus
=
'
create
'
this
.
dialogFormVisible
=
true
this
.
dialogFormVisible
=
true
...
@@ -223,7 +244,7 @@ export default {
...
@@ -223,7 +244,7 @@ export default {
handleUpdate
(
row
)
{
handleUpdate
(
row
)
{
this
.
temp
=
Object
.
assign
({},
row
)
// copy obj
this
.
temp
=
Object
.
assign
({},
row
)
// copy obj
this
.
temp
.
roleId
=
row
.
roles
[
0
].
id
this
.
$set
(
this
.
temp
,
'
roleId
'
,
row
.
roles
[
0
].
id
)
this
.
dialogStatus
=
'
update
'
this
.
dialogStatus
=
'
update
'
this
.
dialogFormVisible
=
true
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -253,6 +274,25 @@ export default {
...
@@ -253,6 +274,25 @@ export default {
})
})
}
}
})
})
},
HandleChangePassword
(
row
)
{
this
.
temp
=
{}
this
.
dialogStatus
=
'
modify
'
this
.
dialogPassword
=
true
this
.
$set
(
this
.
temp
,
'
username
'
,
row
.
username
)
},
changePassword
()
{
changePassword
(
this
.
temp
).
then
(()
=>
{
this
.
dialogPassword
=
false
this
.
$notify
({
title
:
'
成功
'
,
message
:
'
保存成功
'
,
type
:
'
success
'
,
duration
:
2000
})
})
}
}
}
}
}
}
...
...
src/views/user/roleManager.vue
View file @
7c64a533
...
@@ -188,7 +188,9 @@ export default {
...
@@ -188,7 +188,9 @@ export default {
handleUpdate
(
row
)
{
handleUpdate
(
row
)
{
this
.
temp
=
Object
.
assign
({},
row
)
// copy obj
this
.
temp
=
Object
.
assign
({},
row
)
// copy obj
this
.
temp
.
parentId
=
row
.
parent
.
id
if
(
row
.
parent
)
{
this
.
$set
(
this
.
temp
,
'
parentId
'
,
row
.
parent
.
id
)
}
this
.
temp
.
permissions
=
row
.
permissions
.
map
(
i
=>
i
.
id
)
this
.
temp
.
permissions
=
row
.
permissions
.
map
(
i
=>
i
.
id
)
this
.
dialogStatus
=
'
update
'
this
.
dialogStatus
=
'
update
'
this
.
dialogFormVisible
=
true
this
.
dialogFormVisible
=
true
...
...
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