Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
过期的豆豆糖
4.人事管理系统
提交
a3c6b80a
4
4.人事管理系统
项目概览
过期的豆豆糖
/
4.人事管理系统
通知
455
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
4
4.人事管理系统
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a3c6b80a
编写于
5月 06, 2021
作者:
过期的豆豆糖
🎧
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除无效文件
上级
f55f2d78
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
6 addition
and
351 deletion
+6
-351
README.md
README.md
+1
-1
person-admin/pom.xml
person-admin/pom.xml
+0
-20
person-admin/src/main/java/com/person/common/config/KaptchaConfig.java
...src/main/java/com/person/common/config/KaptchaConfig.java
+0
-39
person-admin/src/main/java/com/person/common/config/ShiroConfig.java
...n/src/main/java/com/person/common/config/ShiroConfig.java
+3
-14
person-admin/src/main/java/com/person/common/config/SwaggerConfig.java
...src/main/java/com/person/common/config/SwaggerConfig.java
+0
-52
person-admin/src/main/java/com/person/common/utils/ConfigConstant.java
...src/main/java/com/person/common/utils/ConfigConstant.java
+0
-21
person-admin/src/main/java/com/person/common/utils/Constant.java
...admin/src/main/java/com/person/common/utils/Constant.java
+0
-52
person-admin/src/main/java/com/person/common/utils/RedisUtils.java
...min/src/main/java/com/person/common/utils/RedisUtils.java
+0
-99
person-admin/src/main/java/com/person/modules/sys/controller/SysLoginController.java
...com/person/modules/sys/controller/SysLoginController.java
+0
-40
person-admin/src/main/resources/application.yml
person-admin/src/main/resources/application.yml
+2
-13
未找到文件。
README.md
浏览文件 @
a3c6b80a
...
...
@@ -52,7 +52,7 @@
### 3.档案管理
档案管理子模块:员工档案和合同管理。
#### (1)员工档案
员工
入职资料管理
员工
档案是“系统管理-员工管理”的延伸,即“系统管理-员工管理”是系统的登录账号信息,而员工档案是对账号信息的补充。必须由管理员先创建好账户,才能添加员工档案
![
员工档案-列表
](
https://gitee.com/doudoutang/system-diagram/raw/master/%E4%BA%BA%E4%BA%8B%E7%AE%A1%E7%90%86/3-%E6%A1%A3%E6%A1%88%E7%AE%A1%E7%90%86-%E5%91%98%E5%B7%A5%E6%A1%A3%E6%A1%88-%E5%88%97%E8%A1%A8.png
)
![
员工档案-增加
](
https://gitee.com/doudoutang/system-diagram/raw/master/%E4%BA%BA%E4%BA%8B%E7%AE%A1%E7%90%86/3-%E6%A1%A3%E6%A1%88%E7%AE%A1%E7%90%86-%E5%91%98%E5%B7%A5%E6%A1%A3%E6%A1%88-%E5%A2%9E%E5%8A%A0.png
)
...
...
person-admin/pom.xml
浏览文件 @
a3c6b80a
...
...
@@ -11,11 +11,6 @@
<properties>
<shiro.version>
1.4.0
</shiro.version>
<kaptcha.version>
0.0.9
</kaptcha.version>
<qiniu.version>
7.2.23
</qiniu.version>
<aliyun.oss.version>
2.5.0
</aliyun.oss.version>
<qcloud.cos.version>
4.4
</qcloud.cos.version>
<swagger.version>
2.7.0
</swagger.version>
</properties>
<dependencies>
...
...
@@ -33,21 +28,6 @@
<artifactId>
shiro-spring
</artifactId>
<version>
${shiro.version}
</version>
</dependency>
<dependency>
<groupId>
com.github.axet
</groupId>
<artifactId>
kaptcha
</artifactId>
<version>
${kaptcha.version}
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
${swagger.version}
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
${swagger.version}
</version>
</dependency>
</dependencies>
<build>
...
...
person-admin/src/main/java/com/person/common/config/KaptchaConfig.java
已删除
100644 → 0
浏览文件 @
f55f2d78
/**
*
*
*
*
*
*/
package
com.person.common.config
;
import
com.google.code.kaptcha.impl.DefaultKaptcha
;
import
com.google.code.kaptcha.util.Config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.Properties
;
/**
* 生成验证码配置
*
* @author
*/
@Configuration
public
class
KaptchaConfig
{
@Bean
public
DefaultKaptcha
producer
()
{
Properties
properties
=
new
Properties
();
properties
.
put
(
"kaptcha.border"
,
"no"
);
properties
.
put
(
"kaptcha.textproducer.font.color"
,
"black"
);
properties
.
put
(
"kaptcha.textproducer.char.space"
,
"5"
);
properties
.
put
(
"kaptcha.textproducer.font.names"
,
"Arial,Courier,cmr10,宋体,楷体,微软雅黑"
);
Config
config
=
new
Config
(
properties
);
DefaultKaptcha
defaultKaptcha
=
new
DefaultKaptcha
();
defaultKaptcha
.
setConfig
(
config
);
return
defaultKaptcha
;
}
}
person-admin/src/main/java/com/person/common/config/ShiroConfig.java
浏览文件 @
a3c6b80a
/**
*
*
*
*
*
*/
package
com.person.common.config
;
import
com.person.modules.sys.shiro.UserRealm
;
...
...
@@ -37,8 +29,8 @@ public class ShiroConfig {
* 单机环境,session交给shiro管理
*/
@Bean
@ConditionalOnProperty
(
prefix
=
"
renre
n"
,
name
=
"cluster"
,
havingValue
=
"false"
)
public
DefaultWebSessionManager
sessionManager
(
@Value
(
"${
renre
n.globalSessionTimeout:3600}"
)
long
globalSessionTimeout
){
@ConditionalOnProperty
(
prefix
=
"
perso
n"
,
name
=
"cluster"
,
havingValue
=
"false"
)
public
DefaultWebSessionManager
sessionManager
(
@Value
(
"${
perso
n.globalSessionTimeout:3600}"
)
long
globalSessionTimeout
){
DefaultWebSessionManager
sessionManager
=
new
DefaultWebSessionManager
();
sessionManager
.
setSessionValidationSchedulerEnabled
(
true
);
sessionManager
.
setSessionIdUrlRewritingEnabled
(
false
);
...
...
@@ -52,7 +44,7 @@ public class ShiroConfig {
* 集群环境,session交给spring-session管理
*/
@Bean
@ConditionalOnProperty
(
prefix
=
"
renre
n"
,
name
=
"cluster"
,
havingValue
=
"true"
)
@ConditionalOnProperty
(
prefix
=
"
perso
n"
,
name
=
"cluster"
,
havingValue
=
"true"
)
public
ServletContainerSessionManager
servletContainerSessionManager
()
{
return
new
ServletContainerSessionManager
();
}
...
...
@@ -76,11 +68,8 @@ public class ShiroConfig {
shiroFilter
.
setUnauthorizedUrl
(
"/"
);
Map
<
String
,
String
>
filterMap
=
new
LinkedHashMap
<>();
filterMap
.
put
(
"/swagger/**"
,
"anon"
);
filterMap
.
put
(
"/v2/api-docs"
,
"anon"
);
filterMap
.
put
(
"/swagger-ui.html"
,
"anon"
);
filterMap
.
put
(
"/webjars/**"
,
"anon"
);
filterMap
.
put
(
"/swagger-resources/**"
,
"anon"
);
filterMap
.
put
(
"/statics/**"
,
"anon"
);
filterMap
.
put
(
"/login.html"
,
"anon"
);
...
...
person-admin/src/main/java/com/person/common/config/SwaggerConfig.java
已删除
100644 → 0
浏览文件 @
f55f2d78
/**
*
*
*
*
*
*/
package
com.person.common.config
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
* Swagger配置
*
* @author
*/
@Configuration
@EnableSwagger2
public
class
SwaggerConfig
{
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
select
()
//加了ApiOperation注解的类,生成接口文档
.
apis
(
RequestHandlerSelectors
.
withMethodAnnotation
(
ApiOperation
.
class
))
//包下的类,生成接口文档
.
paths
(
PathSelectors
.
any
())
.
build
();
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
""
)
.
description
(
"renshi-admin文档"
)
.
termsOfServiceUrl
(
""
)
.
version
(
"4.0.0"
)
.
build
();
}
}
\ No newline at end of file
person-admin/src/main/java/com/person/common/utils/ConfigConstant.java
已删除
100644 → 0
浏览文件 @
f55f2d78
/**
*
*
*
*
*
*/
package
com.person.common.utils
;
/**
* 系统参数相关Key
*
* @author
*/
public
class
ConfigConstant
{
/**
* 云存储配置KEY
*/
public
final
static
String
CLOUD_STORAGE_CONFIG_KEY
=
"CLOUD_STORAGE_CONFIG_KEY"
;
}
person-admin/src/main/java/com/person/common/utils/Constant.java
浏览文件 @
a3c6b80a
...
...
@@ -66,57 +66,5 @@ public class Constant {
return
value
;
}
}
/**
* 定时任务状态
*/
public
enum
ScheduleStatus
{
/**
* 正常
*/
NORMAL
(
0
),
/**
* 暂停
*/
PAUSE
(
1
);
private
int
value
;
ScheduleStatus
(
int
value
)
{
this
.
value
=
value
;
}
public
int
getValue
()
{
return
value
;
}
}
/**
* 云服务商
*/
public
enum
CloudService
{
/**
* 七牛云
*/
QINIU
(
1
),
/**
* 阿里云
*/
ALIYUN
(
2
),
/**
* 腾讯云
*/
QCLOUD
(
3
);
private
int
value
;
CloudService
(
int
value
)
{
this
.
value
=
value
;
}
public
int
getValue
()
{
return
value
;
}
}
}
person-admin/src/main/java/com/person/common/utils/RedisUtils.java
已删除
100644 → 0
浏览文件 @
f55f2d78
/**
*
*
*
*
*
*/
package
com.person.common.utils
;
import
com.alibaba.fastjson.JSON
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.*
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.concurrent.TimeUnit
;
/**
* Redis工具类
*
* @author
*/
@Component
public
class
RedisUtils
{
@Autowired
private
RedisTemplate
redisTemplate
;
@Resource
(
name
=
"redisTemplate"
)
private
ValueOperations
<
String
,
String
>
valueOperations
;
@Resource
(
name
=
"redisTemplate"
)
private
HashOperations
<
String
,
String
,
Object
>
hashOperations
;
@Resource
(
name
=
"redisTemplate"
)
private
ListOperations
<
String
,
Object
>
listOperations
;
@Resource
(
name
=
"redisTemplate"
)
private
SetOperations
<
String
,
Object
>
setOperations
;
@Resource
(
name
=
"redisTemplate"
)
private
ZSetOperations
<
String
,
Object
>
zSetOperations
;
/** 默认过期时长,单位:秒 */
public
final
static
long
DEFAULT_EXPIRE
=
60
*
60
*
24
;
/** 不设置过期时长 */
public
final
static
long
NOT_EXPIRE
=
-
1
;
public
void
set
(
String
key
,
Object
value
,
long
expire
){
valueOperations
.
set
(
key
,
toJson
(
value
));
if
(
expire
!=
NOT_EXPIRE
){
redisTemplate
.
expire
(
key
,
expire
,
TimeUnit
.
SECONDS
);
}
}
public
void
set
(
String
key
,
Object
value
){
set
(
key
,
value
,
DEFAULT_EXPIRE
);
}
public
<
T
>
T
get
(
String
key
,
Class
<
T
>
clazz
,
long
expire
)
{
String
value
=
valueOperations
.
get
(
key
);
if
(
expire
!=
NOT_EXPIRE
){
redisTemplate
.
expire
(
key
,
expire
,
TimeUnit
.
SECONDS
);
}
return
value
==
null
?
null
:
fromJson
(
value
,
clazz
);
}
public
<
T
>
T
get
(
String
key
,
Class
<
T
>
clazz
)
{
return
get
(
key
,
clazz
,
NOT_EXPIRE
);
}
public
String
get
(
String
key
,
long
expire
)
{
String
value
=
valueOperations
.
get
(
key
);
if
(
expire
!=
NOT_EXPIRE
){
redisTemplate
.
expire
(
key
,
expire
,
TimeUnit
.
SECONDS
);
}
return
value
;
}
public
String
get
(
String
key
)
{
return
get
(
key
,
NOT_EXPIRE
);
}
public
void
delete
(
String
key
)
{
redisTemplate
.
delete
(
key
);
}
/**
* Object转成JSON数据
*/
private
String
toJson
(
Object
object
){
if
(
object
instanceof
Integer
||
object
instanceof
Long
||
object
instanceof
Float
||
object
instanceof
Double
||
object
instanceof
Boolean
||
object
instanceof
String
){
return
String
.
valueOf
(
object
);
}
return
JSON
.
toJSONString
(
object
);
}
/**
* JSON数据,转成Object
*/
private
<
T
>
T
fromJson
(
String
json
,
Class
<
T
>
clazz
){
return
JSON
.
parseObject
(
json
,
clazz
);
}
}
person-admin/src/main/java/com/person/modules/sys/controller/SysLoginController.java
浏览文件 @
a3c6b80a
/**
*
*
*
*
*
*/
package
com.person.modules.sys.controller
;
import
com.google.code.kaptcha.Constants
;
import
com.google.code.kaptcha.Producer
;
import
com.person.common.utils.R
;
import
com.person.modules.sys.shiro.ShiroUtils
;
import
org.apache.shiro.authc.*
;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.imageio.ImageIO
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.awt.image.BufferedImage
;
import
java.io.IOException
;
/**
* 登录相关
*
...
...
@@ -34,36 +17,13 @@ import java.io.IOException;
*/
@Controller
public
class
SysLoginController
{
@Autowired
private
Producer
producer
;
@RequestMapping
(
"captcha.jpg"
)
public
void
captcha
(
HttpServletResponse
response
)
throws
IOException
{
response
.
setHeader
(
"Cache-Control"
,
"no-store, no-cache"
);
response
.
setContentType
(
"image/jpeg"
);
//生成文字验证码
String
text
=
producer
.
createText
();
//生成图片验证码
BufferedImage
image
=
producer
.
createImage
(
text
);
//保存到shiro session
ShiroUtils
.
setSessionAttribute
(
Constants
.
KAPTCHA_SESSION_KEY
,
text
);
ServletOutputStream
out
=
response
.
getOutputStream
();
ImageIO
.
write
(
image
,
"jpg"
,
out
);
}
/**
* 登录
*/
@ResponseBody
@RequestMapping
(
value
=
"/sys/login"
,
method
=
RequestMethod
.
POST
)
public
R
login
(
String
username
,
String
password
)
{
// String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY);
// if(!captcha.equalsIgnoreCase(kaptcha)){
// return R.error("验证码不正确");
// }
try
{
Subject
subject
=
ShiroUtils
.
getSubject
();
UsernamePasswordToken
token
=
new
UsernamePasswordToken
(
username
,
password
);
...
...
person-admin/src/main/resources/application.yml
浏览文件 @
a3c6b80a
...
...
@@ -19,18 +19,7 @@ spring:
max-file-size
:
100MB
max-request-size
:
100MB
enabled
:
true
redis
:
database
:
0
host
:
localhost
port
:
6379
password
:
# 密码(默认为空)
timeout
:
6000ms
# 连接超时时长(毫秒)
jedis
:
pool
:
max-active
:
1000
# 连接池最大连接数(使用负值表示没有限制)
max-wait
:
-1ms
# 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle
:
10
# 连接池中的最大空闲连接
min-idle
:
5
# 连接池中的最小空闲连接
freemarker
:
suffix
:
.html
request-context-attribute
:
request
...
...
@@ -38,7 +27,7 @@ spring:
devtools
:
restart
:
enabled
:
false
renre
n
:
perso
n
:
cluster
:
false
#集群配置 true集群环境 false单机环境,还需打开pom.xml里的spring-session-data-redis注释
globalSessionTimeout
:
3600
#单机环境,session过期时间为60分钟
redis
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录