-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/controller/HrInfoController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.javaboy.vhr.controller; | ||
|
||
import org.javaboy.vhr.model.Hr; | ||
import org.springframework.security.core.Authentication; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* @作者 江南一点雨 | ||
* @公众号 江南一点雨 | ||
* @微信号 a_java_boy | ||
* @GitHub https://github.com/lenve | ||
* @博客 http://wangsong.blog.csdn.net | ||
* @网站 http://www.javaboy.org | ||
* @时间 2020-03-01 13:07 | ||
*/ | ||
@RestController | ||
public class HrInfoController { | ||
|
||
@GetMapping("/hr/info") | ||
public Hr getCurrentHr(Authentication authentication) { | ||
return ((Hr) authentication.getPrincipal()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,8 @@ | |
message: '已取消操作' | ||
}); | ||
}); | ||
}else if (cmd == 'userinfo') { | ||
this.$router.push('/hrinfo'); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div> | ||
<el-card class="box-card" style="width: 400px"> | ||
<div slot="header" class="clearfix"> | ||
<span>{{hr.name}}</span> | ||
</div> | ||
<div> | ||
<div style="display: flex;justify-content: center"> | ||
<img title="点击修改用户图像" :src="hr.userface" style="width: 100px;height: 100px;border-radius: 50px" | ||
alt=""> | ||
</div> | ||
<div>电话号码: | ||
<el-tag>{{hr.telephone}}</el-tag> | ||
</div> | ||
<div>手机号码: | ||
<el-tag>{{hr.phone}}</el-tag> | ||
</div> | ||
<div>居住地址: | ||
<el-tag>{{hr.address}}</el-tag> | ||
</div> | ||
<div>用户标签: | ||
<el-tag type="success" style="margin-right: 5px" v-for="(r,index) in hr.roles" :key="index"> | ||
{{r.nameZh}} | ||
</el-tag> | ||
</div> | ||
<div style="display: flex;justify-content: space-around;margin-top: 10px"> | ||
<el-button type="primary">修改信息</el-button> | ||
<el-button type="danger">修改密码</el-button> | ||
</div> | ||
</div> | ||
</el-card> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "HrInfo", | ||
data() { | ||
return { | ||
hr: null, | ||
dialogVisible: false | ||
} | ||
}, | ||
mounted() { | ||
this.initHr(); | ||
}, | ||
methods: { | ||
initHr() { | ||
this.getRequest('/hr/info').then(resp => { | ||
if (resp) { | ||
this.hr = resp; | ||
this.hr2 = Object.assign({}, this.hr); | ||
} | ||
}) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |