Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_江南一点雨
vhr
提交
01c2e1c6
V
vhr
项目概览
_江南一点雨
/
vhr
9 个月 前同步成功
通知
393
Star
80
Fork
9
代码
文件
提交
分支
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 搜索 >>
提交
01c2e1c6
编写于
3月 01, 2020
作者:
江
江南一点雨
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加 FastDFS 文件上传
上级
8329c655
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
157 addition
and
27 deletion
+157
-27
vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.java
...mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.java
+2
-0
vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.xml
...-mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.xml
+3
-0
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-service/vhr-service.iml
vhr/vhrserver/vhr-service/vhr-service.iml
+0
-1
vhr/vhrserver/vhr-web/pom.xml
vhr/vhrserver/vhr-web/pom.xml
+5
-0
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/config/FastDFSUtils.java
...eb/src/main/java/org/javaboy/vhr/config/FastDFSUtils.java
+48
-0
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/controller/HrInfoController.java
...ain/java/org/javaboy/vhr/controller/HrInfoController.java
+18
-5
vhr/vhrserver/vhr-web/src/main/resources/application.properties
...rserver/vhr-web/src/main/resources/application.properties
+3
-1
vhr/vhrserver/vhr-web/src/main/resources/fastdfs-client.properties
...rver/vhr-web/src/main/resources/fastdfs-client.properties
+24
-0
vhr/vhrserver/vhr-web/vhr-web.iml
vhr/vhrserver/vhr-web/vhr-web.iml
+1
-1
vuehr/src/views/HrInfo.vue
vuehr/src/views/HrInfo.vue
+49
-19
未找到文件。
vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.java
浏览文件 @
01c2e1c6
...
...
@@ -28,4 +28,6 @@ public interface HrMapper {
List
<
Hr
>
getAllHrsExceptCurrentHr
(
Integer
id
);
Integer
updatePasswd
(
@Param
(
"hrid"
)
Integer
hrid
,
@Param
(
"encodePass"
)
String
encodePass
);
Integer
updateUserface
(
@Param
(
"url"
)
String
url
,
@Param
(
"id"
)
Integer
id
);
}
\ No newline at end of file
vhr/vhrserver/vhr-mapper/src/main/java/org/javaboy/vhr/mapper/HrMapper.xml
浏览文件 @
01c2e1c6
...
...
@@ -161,6 +161,9 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateUserface"
>
update hr set userface = #{url} where id=#{id};
</update>
<update
id=
"updatePasswd"
>
update hr set password = #{encodePass} where id=#{hrid};
</update>
...
...
vhr/vhrserver/vhr-service/src/main/java/org/javaboy/vhr/service/HrService.java
浏览文件 @
01c2e1c6
...
...
@@ -78,4 +78,8 @@ public class HrService implements UserDetailsService {
}
return
false
;
}
public
Integer
updateUserface
(
String
url
,
Integer
id
)
{
return
hrMapper
.
updateUserface
(
url
,
id
);
}
}
vhr/vhrserver/vhr-service/vhr-service.iml
浏览文件 @
01c2e1c6
...
...
@@ -25,7 +25,6 @@
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Maven: org.flywaydb:flyway-core:5.2.4"
level=
"project"
/>
<orderEntry
type=
"module"
module-name=
"vhr-mapper"
/>
<orderEntry
type=
"module"
module-name=
"vhr-model"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-web:2.1.8.RELEASE"
level=
"project"
/>
...
...
vhr/vhrserver/vhr-web/pom.xml
浏览文件 @
01c2e1c6
...
...
@@ -32,6 +32,11 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-websocket
</artifactId>
</dependency>
<dependency>
<groupId>
net.oschina.zcx7878
</groupId>
<artifactId>
fastdfs-client-java
</artifactId>
<version>
1.27.0.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
...
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/config/FastDFSUtils.java
0 → 100644
浏览文件 @
01c2e1c6
package
org.javaboy.vhr.config
;
import
org.csource.common.MyException
;
import
org.csource.fastdfs.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
/**
* @作者 江南一点雨
* @公众号 江南一点雨
* @微信号 a_java_boy
* @GitHub https://github.com/lenve
* @博客 http://wangsong.blog.csdn.net
* @网站 http://www.javaboy.org
* @时间 2020-03-01 22:49
*/
public
class
FastDFSUtils
{
private
static
StorageClient1
client1
;
static
{
try
{
ClientGlobal
.
initByProperties
(
"fastdfs-client.properties"
);
TrackerClient
trackerClient
=
new
TrackerClient
();
TrackerServer
trackerServer
=
trackerClient
.
getConnection
();
StorageServer
storageServer
=
null
;
client1
=
new
StorageClient1
(
trackerServer
,
storageServer
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
MyException
e
)
{
e
.
printStackTrace
();
}
}
public
static
String
upload
(
MultipartFile
file
)
{
String
name
=
file
.
getOriginalFilename
();
String
s
=
null
;
try
{
s
=
client1
.
upload_file1
(
file
.
getBytes
(),
name
.
substring
(
name
.
lastIndexOf
(
"."
)
+
1
),
null
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
MyException
e
)
{
e
.
printStackTrace
();
}
return
s
;
}
}
vhr/vhrserver/vhr-web/src/main/java/org/javaboy/vhr/controller/HrInfoController.java
浏览文件 @
01c2e1c6
package
org.javaboy.vhr.controller
;
import
org.javaboy.vhr.config.FastDFSUtils
;
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.beans.factory.annotation.Value
;
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
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.Map
;
...
...
@@ -27,6 +27,9 @@ public class HrInfoController {
@Autowired
HrService
hrService
;
@Value
(
"${javaboy.nginx.host}"
)
String
nginxHost
;
@GetMapping
(
"/hr/info"
)
public
Hr
getCurrentHr
(
Authentication
authentication
)
{
return
((
Hr
)
authentication
.
getPrincipal
());
...
...
@@ -51,4 +54,14 @@ public class HrInfoController {
return
RespBean
.
error
(
"更新失败!"
);
}
}
@PostMapping
(
"/hr/userface"
)
public
RespBean
updateUserface
(
MultipartFile
file
,
Integer
id
)
{
String
upload
=
FastDFSUtils
.
upload
(
file
);
String
url
=
nginxHost
+
upload
;
if
(
hrService
.
updateUserface
(
url
,
id
)
==
1
)
{
return
RespBean
.
ok
(
"更新成功!"
,
url
);
}
return
RespBean
.
error
(
"更新失败!"
);
}
}
\ No newline at end of file
vhr/vhrserver/vhr-web/src/main/resources/application.properties
浏览文件 @
01c2e1c6
...
...
@@ -16,4 +16,6 @@ spring.redis.host=192.168.91.128
spring.redis.database
=
0
spring.redis.port
=
6379
spring.redis.password
=
123
spring.cache.cache-names
=
menus_cache
\ No newline at end of file
spring.cache.cache-names
=
menus_cache
# FastDFS 文件地址
javaboy.nginx.host
=
http://192.168.91.128/
\ No newline at end of file
vhr/vhrserver/vhr-web/src/main/resources/fastdfs-client.properties
0 → 100644
浏览文件 @
01c2e1c6
## fastdfs-client.properties
fastdfs.connect_timeout_in_seconds
=
5
fastdfs.network_timeout_in_seconds
=
30
fastdfs.charset
=
UTF-8
fastdfs.http_anti_steal_token
=
false
fastdfs.http_secret_key
=
FastDFS1234567890
fastdfs.http_tracker_http_port
=
80
fastdfs.tracker_servers
=
192.168.91.128:22122
## Whether to open the connection pool, if not, create a new connection every time
fastdfs.connection_pool.enabled
=
true
## max_count_per_entry: max connection count per host:port , 0 is not limit
fastdfs.connection_pool.max_count_per_entry
=
500
## connections whose the idle time exceeds this time will be closed, unit: second, default value is 3600
fastdfs.connection_pool.max_idle_time
=
3600
## Maximum waiting time when the maximum number of connections is reached, unit: millisecond, default value is 1000
fastdfs.connection_pool.max_wait_time_in_ms
=
1000
\ No newline at end of file
vhr/vhrserver/vhr-web/vhr-web.iml
浏览文件 @
01c2e1c6
...
...
@@ -25,7 +25,6 @@
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Maven: org.flywaydb:flyway-core:5.2.4"
level=
"project"
/>
<orderEntry
type=
"module"
module-name=
"vhr-service"
/>
<orderEntry
type=
"module"
module-name=
"vhr-mapper"
/>
<orderEntry
type=
"module"
module-name=
"vhr-model"
/>
...
...
@@ -91,6 +90,7 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-beans:5.1.9.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-websocket:5.1.9.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-context:5.1.9.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.oschina.zcx7878:fastdfs-client-java:1.27.0.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-starter-test:2.1.8.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter:2.1.8.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot:2.1.8.RELEASE"
level=
"project"
/>
...
...
vuehr/src/views/HrInfo.vue
浏览文件 @
01c2e1c6
...
...
@@ -6,8 +6,15 @@
</div>
<div>
<div
style=
"display: flex;justify-content: center"
>
<img
title=
"点击修改用户图像"
:src=
"hr.userface"
style=
"width: 100px;height: 100px;border-radius: 50px"
alt=
""
>
<el-upload
:data=
"hr"
:show-file-list=
"false"
:on-success=
"onSuccess"
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>
...
...
@@ -34,7 +41,8 @@
:visible.sync=
"passwdDialogVisible"
width=
"30%"
>
<div>
<el-form
:model=
"ruleForm"
status-icon
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<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>
...
...
@@ -58,20 +66,36 @@
<div>
<table>
<tr>
<td><el-tag>
用户姓名:
</el-tag></td>
<td><el-input
v-model=
"hr2.name"
></el-input></td>
<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>
<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>
<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>
<td>
<el-tag>
用户地址:
</el-tag>
</td>
<td>
<el-input
v-model=
"hr2.address"
></el-input>
</td>
</tr>
</table>
</div>
...
...
@@ -108,36 +132,42 @@
};
return
{
ruleForm
:
{
oldpass
:
''
,
oldpass
:
''
,
pass
:
''
,
checkPass
:
''
},
rules
:
{
oldpass
:
[
{
validator
:
validatePass
,
trigger
:
'
blur
'
}
{
validator
:
validatePass
,
trigger
:
'
blur
'
}
],
pass
:
[
{
validator
:
validatePass
,
trigger
:
'
blur
'
}
{
validator
:
validatePass
,
trigger
:
'
blur
'
}
],
checkPass
:
[
{
validator
:
validatePass2
,
trigger
:
'
blur
'
}
{
validator
:
validatePass2
,
trigger
:
'
blur
'
}
]
},
hr
:
null
,
hr2
:
null
,
passwdDialogVisible
:
false
,
dialogVisible
:
false
passwdDialogVisible
:
false
,
dialogVisible
:
false
}
},
mounted
()
{
this
.
initHr
();
},
methods
:
{
onSuccess
()
{
this
.
getRequest
(
"
/logout
"
);
window
.
sessionStorage
.
removeItem
(
"
user
"
)
this
.
$store
.
commit
(
'
initRoutes
'
,
[]);
this
.
$router
.
replace
(
"
/
"
);
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
ruleForm
.
hrid
=
this
.
hr
.
id
;
this
.
putRequest
(
"
/hr/pass
"
,
this
.
ruleForm
).
then
(
resp
=>
{
this
.
putRequest
(
"
/hr/pass
"
,
this
.
ruleForm
).
then
(
resp
=>
{
if
(
resp
)
{
this
.
getRequest
(
"
/logout
"
);
window
.
sessionStorage
.
removeItem
(
"
user
"
)
...
...
@@ -157,7 +187,7 @@
this
.
passwdDialogVisible
=
true
;
},
updateHrInfo
()
{
this
.
putRequest
(
"
/hr/info
"
,
this
.
hr2
).
then
(
resp
=>
{
this
.
putRequest
(
"
/hr/info
"
,
this
.
hr2
).
then
(
resp
=>
{
if
(
resp
)
{
this
.
getRequest
(
"
/logout
"
);
window
.
sessionStorage
.
removeItem
(
"
user
"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录