Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
鲈小鱼&奥术猫
vhr
提交
c2448a72
V
vhr
项目概览
鲈小鱼&奥术猫
/
vhr
与 Fork 源项目一致
Fork自
_江南一点雨 / vhr
通知
1
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 搜索 >>
提交
c2448a72
编写于
3月 02, 2020
作者:
江
江南一点雨
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完善个人中心
上级
01c2e1c6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
69 addition
and
63 deletion
+69
-63
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/config/FastDFSUtils.java
...eb/src/main/java/org/javaboy/vhr/config/FastDFSUtils.java
+9
-8
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/controller/HrInfoController.java
...ain/java/org/javaboy/vhr/controller/HrInfoController.java
+13
-7
vhr/vhrserver/vhr-web/src/main/resources/application.properties
...rserver/vhr-web/src/main/resources/application.properties
+2
-2
vuehr/src/views/Home.vue
vuehr/src/views/Home.vue
+4
-1
vuehr/src/views/HrInfo.vue
vuehr/src/views/HrInfo.vue
+41
-45
未找到文件。
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/config/FastDFSUtils.java
浏览文件 @
c2448a72
package
org.javaboy.vhr.config
;
import
org.csource.common.MyException
;
import
org.csource.fastdfs.*
;
import
org.csource.fastdfs.ClientGlobal
;
import
org.csource.fastdfs.StorageClient1
;
import
org.csource.fastdfs.TrackerClient
;
import
org.csource.fastdfs.TrackerServer
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
...
...
@@ -13,7 +16,7 @@ import java.io.IOException;
* @GitHub https://github.com/lenve
* @博客 http://wangsong.blog.csdn.net
* @网站 http://www.javaboy.org
* @时间 2020-03-0
1 22:49
* @时间 2020-03-0
2 23:26
*/
public
class
FastDFSUtils
{
private
static
StorageClient1
client1
;
...
...
@@ -23,8 +26,7 @@ public class FastDFSUtils {
ClientGlobal
.
initByProperties
(
"fastdfs-client.properties"
);
TrackerClient
trackerClient
=
new
TrackerClient
();
TrackerServer
trackerServer
=
trackerClient
.
getConnection
();
StorageServer
storageServer
=
null
;
client1
=
new
StorageClient1
(
trackerServer
,
storageServer
);
client1
=
new
StorageClient1
(
trackerServer
,
null
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
MyException
e
)
{
...
...
@@ -33,16 +35,15 @@ public class FastDFSUtils {
}
public
static
String
upload
(
MultipartFile
file
)
{
String
name
=
file
.
getOriginalFilename
();
String
s
=
null
;
String
oldName
=
file
.
getOriginalFilename
();
try
{
s
=
client1
.
upload_file1
(
file
.
getBytes
(),
name
.
substring
(
n
ame
.
lastIndexOf
(
"."
)
+
1
),
null
);
return
client1
.
upload_file1
(
file
.
getBytes
(),
oldName
.
substring
(
oldN
ame
.
lastIndexOf
(
"."
)
+
1
),
null
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
MyException
e
)
{
e
.
printStackTrace
();
}
return
s
;
return
null
;
}
}
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/controller/HrInfoController.java
浏览文件 @
c2448a72
...
...
@@ -6,7 +6,9 @@ import org.javaboy.vhr.model.RespBean;
import
org.javaboy.vhr.service.HrService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -27,7 +29,7 @@ public class HrInfoController {
@Autowired
HrService
hrService
;
@Value
(
"${
javaboy
.nginx.host}"
)
@Value
(
"${
fastdfs
.nginx.host}"
)
String
nginxHost
;
@GetMapping
(
"/hr/info"
)
...
...
@@ -36,8 +38,9 @@ public class HrInfoController {
}
@PutMapping
(
"/hr/info"
)
public
RespBean
updateHyById
(
@RequestBody
Hr
hr
)
{
if
(
hrService
.
updateHyById
(
hr
)
==
1
)
{
public
RespBean
updateHr
(
@RequestBody
Hr
hr
,
Authentication
authentication
)
{
if
(
hrService
.
updateHr
(
hr
)
==
1
)
{
SecurityContextHolder
.
getContext
().
setAuthentication
(
new
UsernamePasswordAuthenticationToken
(
hr
,
authentication
.
getCredentials
(),
authentication
.
getAuthorities
()));
return
RespBean
.
ok
(
"更新成功!"
);
}
return
RespBean
.
error
(
"更新失败!"
);
...
...
@@ -55,11 +58,14 @@ public class HrInfoController {
}
@PostMapping
(
"/hr/userface"
)
public
RespBean
update
Userface
(
MultipartFile
file
,
Integer
id
)
{
String
uploa
d
=
FastDFSUtils
.
upload
(
file
);
String
url
=
nginxHost
+
uploa
d
;
public
RespBean
update
HrUserface
(
MultipartFile
file
,
Integer
id
,
Authentication
authentication
)
{
String
fileI
d
=
FastDFSUtils
.
upload
(
file
);
String
url
=
nginxHost
+
fileI
d
;
if
(
hrService
.
updateUserface
(
url
,
id
)
==
1
)
{
return
RespBean
.
ok
(
"更新成功!"
,
url
);
Hr
hr
=
(
Hr
)
authentication
.
getPrincipal
();
hr
.
setUserface
(
url
);
SecurityContextHolder
.
getContext
().
setAuthentication
(
new
UsernamePasswordAuthenticationToken
(
hr
,
authentication
.
getCredentials
(),
authentication
.
getAuthorities
()));
return
RespBean
.
ok
(
"更新成功!"
,
url
);
}
return
RespBean
.
error
(
"更新失败!"
);
}
...
...
vhr/vhrserver/vhr-web/src/main/resources/application.properties
浏览文件 @
c2448a72
...
...
@@ -17,5 +17,5 @@ spring.redis.database=0
spring.redis.port
=
6379
spring.redis.password
=
123
spring.cache.cache-names
=
menus_cache
# FastDFS 文件地址
javaboy.nginx.host
=
http://192.168.91.128/
\ No newline at end of file
fastdfs.nginx.host
=
http://192.168.91.128/
\ No newline at end of file
vuehr/src/views/Home.vue
浏览文件 @
c2448a72
...
...
@@ -51,12 +51,15 @@
name
:
"
Home
"
,
data
()
{
return
{
user
:
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
"
user
"
))
//
user: JSON.parse(window.sessionStorage.getItem("user"))
}
},
computed
:
{
routes
()
{
return
this
.
$store
.
state
.
routes
;
},
user
()
{
return
this
.
$store
.
state
.
currentHr
;
}
},
methods
:
{
...
...
vuehr/src/views/HrInfo.vue
浏览文件 @
c2448a72
...
...
@@ -7,14 +7,13 @@
<div>
<div
style=
"display: flex;justify-content: center"
>
<el-upload
:data=
"hr"
:show-file-list=
"false"
:on-success=
"onSuccess"
:data=
"hr"
action=
"/hr/userface"
>
<img
title=
"点击修改用户图像"
:src=
"hr.userface"
style=
"width: 100px;height: 100px;border-radius: 50px"
alt=
""
>
</el-upload>
</div>
<div>
电话号码:
<el-tag>
{{
hr
.
telephone
}}
</el-tag>
...
...
@@ -36,29 +35,6 @@
</div>
</div>
</el-card>
<el-dialog
title=
"修改密码"
:visible.sync=
"passwdDialogVisible"
width=
"30%"
>
<div>
<el-form
:model=
"ruleForm"
status-icon
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"请输入旧密码"
prop=
"oldpass"
>
<el-input
type=
"password"
v-model=
"ruleForm.oldpass"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"请输入新密码"
prop=
"pass"
>
<el-input
type=
"password"
v-model=
"ruleForm.pass"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"新确认密码"
prop=
"checkPass"
>
<el-input
type=
"password"
v-model=
"ruleForm.checkPass"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
提交
</el-button>
<el-button
@
click=
"resetForm('ruleForm')"
>
重置
</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
<el-dialog
title=
"修改用户信息"
:visible.sync=
"dialogVisible"
...
...
@@ -67,7 +43,7 @@
<table>
<tr>
<td>
<el-tag>
用户
姓名
:
</el-tag>
<el-tag>
用户
昵称
:
</el-tag>
</td>
<td>
<el-input
v-model=
"hr2.name"
></el-input>
...
...
@@ -104,6 +80,29 @@
<el-button
type=
"primary"
@
click=
"updateHrInfo"
>
确 定
</el-button>
</span>
</el-dialog>
<el-dialog
title=
"修改密码"
:visible.sync=
"passwdDialogVisible"
width=
"30%"
>
<div>
<el-form
:model=
"ruleForm"
status-icon
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"请输入旧密码"
prop=
"oldpass"
>
<el-input
type=
"password"
v-model=
"ruleForm.oldpass"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"请输入新密码"
prop=
"pass"
>
<el-input
type=
"password"
v-model=
"ruleForm.pass"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"新确认密码"
prop=
"checkPass"
>
<el-input
type=
"password"
v-model=
"ruleForm.checkPass"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
提交
</el-button>
<el-button
@
click=
"resetForm('ruleForm')"
>
重置
</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</
template
>
...
...
@@ -149,8 +148,8 @@
},
hr
:
null
,
hr2
:
null
,
passwdD
ialogVisible
:
false
,
d
ialogVisible
:
false
d
ialogVisible
:
false
,
passwdD
ialogVisible
:
false
}
},
mounted
()
{
...
...
@@ -158,10 +157,18 @@
},
methods
:
{
onSuccess
()
{
this
.
getRequest
(
"
/logout
"
);
window
.
sessionStorage
.
removeItem
(
"
user
"
)
this
.
$store
.
commit
(
'
initRoutes
'
,
[]);
this
.
$router
.
replace
(
"
/
"
);
this
.
initHr
();
},
updateHrInfo
()
{
this
.
putRequest
(
"
/hr/info
"
,
this
.
hr2
).
then
(
resp
=>
{
if
(
resp
)
{
this
.
dialogVisible
=
false
;
this
.
initHr
();
}
})
},
showUpdateHrInfoView
()
{
this
.
dialogVisible
=
true
;
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
...
...
@@ -186,24 +193,13 @@
showUpdatePasswdView
()
{
this
.
passwdDialogVisible
=
true
;
},
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
);
window
.
sessionStorage
.
setItem
(
"
user
"
,
JSON
.
stringify
(
resp
));
this
.
$store
.
commit
(
'
INIT_CURRENTHR
'
,
resp
);
}
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录