Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HeliosJ
gin-vue-admin
提交
fae4df79
G
gin-vue-admin
项目概览
HeliosJ
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
fae4df79
编写于
3月 15, 2020
作者:
Mr.奇淼(
提交者:
GitHub
3月 15, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #25 from ly303550688/AddModifyPassword
Add modify password
上级
afaf08b3
5af816d4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
123 addition
and
40 deletion
+123
-40
QMPlusVuePage/src/api/user.js
QMPlusVuePage/src/api/user.js
+11
-1
QMPlusVuePage/src/view/layout/index.vue
QMPlusVuePage/src/view/layout/index.vue
+112
-39
未找到文件。
QMPlusVuePage/src/api/user.js
浏览文件 @
fae4df79
...
...
@@ -23,7 +23,17 @@ export const regist = (data) => {
data
:
data
})
}
// @Summary 修改密码
// @Produce application/json
// @Param data body {username:"string",password:"string",newPassword:"string"}
// @Router /user/changePassword [post]
export
const
changePassword
=
(
data
)
=>
{
return
service
({
url
:
"
/user/changePassword
"
,
method
:
'
post
'
,
data
:
data
})
}
// @Tags User
// @Summary 分页获取用户列表
// @Security ApiKeyAuth
...
...
QMPlusVuePage/src/view/layout/index.vue
浏览文件 @
fae4df79
<
template
>
<el-container
class=
"layout-cont"
>
<el-container
class=
"layout-cont"
>
<el-container
:class=
"[isSider?'openside':'hideside',isMobile ? 'mobile': '']"
>
<el-row
:class=
"[isShadowBg?'shadowBg':'']"
@
click.native=
"changeShadow()"
></el-row>
<el-aside
class=
"main-cont main-left"
>
...
...
@@ -27,10 +27,33 @@
<el-badge
is-dot
/>
</span>
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"showPassword=true"
icon=
"el-icon-s-custom"
>
修改密码
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"toPerson"
icon=
"el-icon-s-custom"
>
个人信息
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"LoginOut"
icon=
"el-icon-table-lamp"
>
登 出
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dialog
title=
"修改密码"
:visible.sync=
"showPassword"
@
close=
"clearPassword"
width=
"360px"
>
<el-form
ref=
"modifyPwdForm"
:model=
"pwdModify"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
prop=
"password"
:minlength=
"6"
label=
"原密码"
>
<el-input
v-model=
"pwdModify.password"
show-password
></el-input>
</el-form-item>
<el-form-item
prop=
"newPassword"
:minlength=
"6"
label=
"新密码"
>
<el-input
v-model=
"pwdModify.newPassword"
show-password
></el-input>
</el-form-item>
<el-form-item
prop=
"confirmPassword"
:minlength=
"6"
label=
"确认密码"
>
<el-input
v-model=
"pwdModify.confirmPassword"
show-password
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"showPassword=false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"savePassword"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</el-header>
<!-- 当前面包屑用路由自动生成可根据需求修改 -->
...
...
@@ -53,6 +76,7 @@
<
script
>
import
Aside
from
'
@/view/layout/aside
'
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
import
{
changePassword
}
from
'
@/api/user
'
export
default
{
name
:
'
Layout
'
,
data
()
{
...
...
@@ -60,19 +84,45 @@ export default {
isCollapse
:
false
,
isSider
:
true
,
isMobile
:
false
,
isShadowBg
:
false
isShadowBg
:
false
,
showPassword
:
false
,
pwdModify
:
{},
rules
:
{
password
:
[
{
required
:
true
,
message
:
'
请输入密码
'
,
trigger
:
'
blur
'
},
{
min
:
6
,
message
:
'
最少6个字符
'
,
trigger
:
'
blur
'
}
],
newPassword
:
[
{
required
:
true
,
message
:
'
请输入新密码
'
,
trigger
:
'
blur
'
},
{
min
:
6
,
message
:
'
最少6个字符
'
,
trigger
:
'
blur
'
}
],
confirmPassword
:
[
{
required
:
true
,
message
:
'
请输入确认密码
'
,
trigger
:
'
blur
'
},
{
min
:
6
,
message
:
'
最少6个字符
'
,
trigger
:
'
blur
'
},
{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
value
!==
this
.
pwdModify
.
newPassword
)
{
callback
(
new
Error
(
'
两次密码不一致
'
))
}
else
{
callback
()
}
},
trigger
:
'
blur
'
}
]
}
}
},
components
:
{
Aside
},
created
(){
created
()
{
let
screenWidth
=
document
.
body
.
clientWidth
if
(
screenWidth
<
1000
)
{
if
(
screenWidth
<
1000
)
{
this
.
isMobile
=
true
this
.
isSider
=
false
this
.
isCollapse
=
!
this
.
isCollapse
}
else
{
}
else
{
this
.
isMobile
=
false
}
},
...
...
@@ -87,12 +137,35 @@ export default {
toPerson
()
{
this
.
$router
.
push
({
name
:
'
person
'
})
},
changeShadow
(){
changeShadow
()
{
this
.
isShadowBg
=
!
this
.
isShadowBg
this
.
isSider
=
!!
this
.
isCollapse
this
.
totalCollapse
()
},
savePassword
()
{
this
.
$refs
.
modifyPwdForm
.
validate
(
valid
=>
{
if
(
valid
)
{
changePassword
({
username
:
this
.
userInfo
.
userName
,
password
:
this
.
pwdModify
.
password
,
newPassword
:
this
.
pwdModify
.
newPassword
}).
then
(()
=>
{
this
.
$message
.
success
(
'
修改密码成功!
'
)
this
.
showPassword
=
false
})
}
else
{
return
false
}
})
},
clearPassword
()
{
this
.
pwdModify
=
{
password
:
''
,
newPassword
:
''
,
confirmPassword
:
''
}
this
.
$refs
.
modifyPwdForm
.
clearValidate
()
}
},
computed
:
{
...
mapGetters
(
'
user
'
,
[
'
userInfo
'
]),
...
...
@@ -107,15 +180,15 @@ export default {
window
.
onresize
=
()
=>
{
return
(()
=>
{
let
screenWidth
=
document
.
body
.
clientWidth
if
(
!
this
.
screenWidth
&&
this
.
isSider
)
{
if
(
screenWidth
<
1000
)
{
if
(
!
this
.
screenWidth
&&
this
.
isSider
)
{
if
(
screenWidth
<
1000
)
{
this
.
isMobile
=
true
this
.
isSider
=
false
this
.
isCollapse
=
true
this
.
$bus
.
emit
(
'
collapse
'
,
this
.
isCollapse
)
this
.
$bus
.
emit
(
'
collapse
'
,
this
.
isCollapse
)
}
}
else
{
if
(
screenWidth
<
1000
)
{
}
else
{
if
(
screenWidth
<
1000
)
{
this
.
isMobile
=
true
this
.
isSider
=
false
this
.
isCollapse
=
true
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录