Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wobushiyun
vhr
提交
28d3953d
V
vhr
项目概览
wobushiyun
/
vhr
与 Fork 源项目一致
Fork自
_江南一点雨 / vhr
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vhr
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
28d3953d
编写于
3月 01, 2020
作者:
江
江南一点雨
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
个人中心修改个人信息
上级
2efd1be0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
67 addition
and
2 deletion
+67
-2
vhr/vhrserver/vhr-service/src/main/java/org/javaboy/vhr/service/HrService.java
...vice/src/main/java/org/javaboy/vhr/service/HrService.java
+4
-0
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/controller/HrInfoController.java
...ain/java/org/javaboy/vhr/controller/HrInfoController.java
+16
-0
vuehr/src/views/HrInfo.vue
vuehr/src/views/HrInfo.vue
+47
-2
未找到文件。
vhr/vhrserver/vhr-service/src/main/java/org/javaboy/vhr/service/HrService.java
浏览文件 @
28d3953d
...
...
@@ -60,4 +60,8 @@ public class HrService implements UserDetailsService {
public
List
<
Hr
>
getAllHrsExceptCurrentHr
()
{
return
hrMapper
.
getAllHrsExceptCurrentHr
(
HrUtils
.
getCurrentHr
().
getId
());
}
public
Integer
updateHyById
(
Hr
hr
)
{
return
hrMapper
.
updateByPrimaryKeySelective
(
hr
);
}
}
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/controller/HrInfoController.java
浏览文件 @
28d3953d
package
org.javaboy.vhr.controller
;
import
org.javaboy.vhr.model.Hr
;
import
org.javaboy.vhr.model.RespBean
;
import
org.javaboy.vhr.service.HrService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
/**
...
...
@@ -17,8 +22,19 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public
class
HrInfoController
{
@Autowired
HrService
hrService
;
@GetMapping
(
"/hr/info"
)
public
Hr
getCurrentHr
(
Authentication
authentication
)
{
return
((
Hr
)
authentication
.
getPrincipal
());
}
@PutMapping
(
"/hr/info"
)
public
RespBean
updateHyById
(
@RequestBody
Hr
hr
)
{
if
(
hrService
.
updateHyById
(
hr
)
==
1
)
{
return
RespBean
.
ok
(
"更新成功!"
);
}
return
RespBean
.
error
(
"更新失败!"
);
}
}
vuehr/src/views/HrInfo.vue
浏览文件 @
28d3953d
...
...
@@ -24,11 +24,40 @@
</el-tag>
</div>
<div
style=
"display: flex;justify-content: space-around;margin-top: 10px"
>
<el-button
type=
"primary"
>
修改信息
</el-button>
<el-button
type=
"primary"
@
click=
"showUpdateHrInfoView"
>
修改信息
</el-button>
<el-button
type=
"danger"
>
修改密码
</el-button>
</div>
</div>
</el-card>
<el-dialog
title=
"修改用户信息"
:visible.sync=
"dialogVisible"
width=
"30%"
>
<div>
<table>
<tr>
<td><el-tag>
用户姓名:
</el-tag></td>
<td><el-input
v-model=
"hr2.name"
></el-input></td>
</tr>
<tr>
<td><el-tag>
电话号码:
</el-tag></td>
<td><el-input
v-model=
"hr2.telephone"
></el-input></td>
</tr>
<tr>
<td><el-tag>
手机号码:
</el-tag></td>
<td><el-input
v-model=
"hr2.phone"
></el-input></td>
</tr>
<tr>
<td><el-tag>
用户地址:
</el-tag></td>
<td><el-input
v-model=
"hr2.address"
></el-input></td>
</tr>
</table>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"updateHrInfo"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</
template
>
...
...
@@ -37,17 +66,33 @@
name
:
"
HrInfo
"
,
data
()
{
return
{
hr
:
null
hr
:
null
,
hr2
:
null
,
dialogVisible
:
false
}
},
mounted
()
{
this
.
initHr
();
},
methods
:
{
updateHrInfo
()
{
this
.
putRequest
(
"
/hr/info
"
,
this
.
hr2
).
then
(
resp
=>
{
if
(
resp
)
{
this
.
getRequest
(
"
/logout
"
);
window
.
sessionStorage
.
removeItem
(
"
user
"
)
this
.
$store
.
commit
(
'
initRoutes
'
,
[]);
this
.
$router
.
replace
(
"
/
"
);
}
})
},
showUpdateHrInfoView
()
{
this
.
dialogVisible
=
true
;
},
initHr
()
{
this
.
getRequest
(
'
/hr/info
'
).
then
(
resp
=>
{
if
(
resp
)
{
this
.
hr
=
resp
;
this
.
hr2
=
Object
.
assign
({},
this
.
hr
);
}
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录