Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
59b6544f
Commit
59b6544f
authored
Jun 07, 2017
by
naan1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加一个属性控制session失效时间
parent
f3ebc991
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
src/main/java/com/stylefeng/guns/config/properties/GunsProperties.java
+14
-4
src/main/resources/application.yml
+1
-0
No files found.
src/main/java/com/stylefeng/guns/config/properties/GunsProperties.java
View file @
59b6544f
...
@@ -28,17 +28,19 @@ public class GunsProperties {
...
@@ -28,17 +28,19 @@ public class GunsProperties {
private
Boolean
haveCreatePath
=
false
;
private
Boolean
haveCreatePath
=
false
;
private
Integer
sessionInvalidateTime
=
10
*
60
;
//session 失效时间(默认为10分钟 单位:秒)
public
String
getFileUploadPath
()
{
public
String
getFileUploadPath
()
{
//如果没有写文件上传路径,保存到临时目录
//如果没有写文件上传路径,保存到临时目录
if
(
isEmpty
(
fileUploadPath
))
{
if
(
isEmpty
(
fileUploadPath
))
{
return
getTempPath
();
return
getTempPath
();
}
else
{
}
else
{
//判断有没有结尾符,没有得加上
//判断有没有结尾符,没有得加上
if
(!
fileUploadPath
.
endsWith
(
File
.
separator
))
{
if
(!
fileUploadPath
.
endsWith
(
File
.
separator
))
{
fileUploadPath
=
fileUploadPath
+
File
.
separator
;
fileUploadPath
=
fileUploadPath
+
File
.
separator
;
}
}
//判断目录存不存在,不存在得加上
//判断目录存不存在,不存在得加上
if
(
haveCreatePath
==
false
)
{
if
(
haveCreatePath
==
false
)
{
File
file
=
new
File
(
fileUploadPath
);
File
file
=
new
File
(
fileUploadPath
);
file
.
mkdirs
();
file
.
mkdirs
();
haveCreatePath
=
true
;
haveCreatePath
=
true
;
...
@@ -66,4 +68,12 @@ public class GunsProperties {
...
@@ -66,4 +68,12 @@ public class GunsProperties {
public
void
setSwaggerOpen
(
Boolean
swaggerOpen
)
{
public
void
setSwaggerOpen
(
Boolean
swaggerOpen
)
{
this
.
swaggerOpen
=
swaggerOpen
;
this
.
swaggerOpen
=
swaggerOpen
;
}
}
public
Integer
getSessionInvalidateTime
()
{
return
sessionInvalidateTime
;
}
public
void
setSessionInvalidateTime
(
Integer
sessionInvalidateTime
)
{
this
.
sessionInvalidateTime
=
sessionInvalidateTime
;
}
}
}
src/main/resources/application.yml
View file @
59b6544f
...
@@ -7,6 +7,7 @@ guns:
...
@@ -7,6 +7,7 @@ guns:
swagger-open
:
true
#是否开启swagger (true/false)
swagger-open
:
true
#是否开启swagger (true/false)
kaptcha-open
:
false
#是否开启登录时验证码 (true/false)
kaptcha-open
:
false
#是否开启登录时验证码 (true/false)
#file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录)
#file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录)
session-invalidate-time
:
600
#session失效时间 单位:秒
################### 项目启动端口 ###################
################### 项目启动端口 ###################
server
:
server
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment