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
fd0f480f
Commit
fd0f480f
authored
May 24, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
头像上传完善
parent
85932501
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
src/main/java/com/stylefeng/guns/config/properties/GunsProperties.java
+15
-1
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/com/stylefeng/guns/config/properties/GunsProperties.java
View file @
fd0f480f
...
...
@@ -3,6 +3,8 @@ package com.stylefeng.guns.config.properties;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
import
java.io.File
;
import
static
com
.
stylefeng
.
guns
.
core
.
util
.
ToolUtil
.
getTempPath
;
import
static
com
.
stylefeng
.
guns
.
core
.
util
.
ToolUtil
.
isEmpty
;
...
...
@@ -22,11 +24,23 @@ public class GunsProperties {
private
String
fileUploadPath
;
private
Boolean
haveCreatePath
=
false
;
public
String
getFileUploadPath
()
{
//如果没有写文件上传路径
//如果没有写文件上传路径
,保存到临时目录
if
(
isEmpty
(
fileUploadPath
)){
return
getTempPath
();
}
else
{
//判断有没有结尾符,没有得加上
if
(!
fileUploadPath
.
endsWith
(
File
.
separator
)){
fileUploadPath
=
fileUploadPath
+
File
.
separator
;
}
//判断目录存不存在,不存在得加上
if
(
haveCreatePath
==
false
){
File
file
=
new
File
(
fileUploadPath
);
file
.
mkdirs
();
haveCreatePath
=
true
;
}
return
fileUploadPath
;
}
}
...
...
src/main/resources/application.yml
View file @
fd0f480f
################### guns项目独有的配置 ###################
guns
:
kaptcha-open
:
false
#是否开启登录时验证码 (true/false)
file-upload-path
:
#file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录)
################### 项目启动端口 ###################
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