Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
吴学德
gdtel-gztel-school-center
Commits
11b7c72a
Commit
11b7c72a
authored
Oct 19, 2020
by
黎配弘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
尝试修复路径遍历的问题
parent
480fbe41
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
service-manager/src/main/java/com/winsun/controller/PackageController.java
+5
-9
No files found.
service-manager/src/main/java/com/winsun/controller/PackageController.java
View file @
11b7c72a
...
@@ -186,21 +186,17 @@ public class PackageController extends BaseController {
...
@@ -186,21 +186,17 @@ public class PackageController extends BaseController {
@Permission
(
menuname
=
"上传背景图"
,
value
=
"backgroundUpload"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"上传背景图"
,
value
=
"backgroundUpload"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
backgroundUpload
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
,
@RequestParam
(
value
=
"id"
,
required
=
false
)
int
id
)
{
public
ResponseData
<
String
>
backgroundUpload
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
,
@RequestParam
(
value
=
"id"
,
required
=
false
)
int
id
)
{
String
subfix
=
""
;
String
Builder
basePath
=
new
StringBuilder
()
;
String
backgroundpath
=
FilePath
.
BACKGROUNDIMG
.
getValue
()
+
"/"
+
DEFAULTPATH
+
"/"
;
basePath
.
append
(
FilePath
.
BACKGROUNDIMG
.
getValue
()).
append
(
File
.
separator
).
append
(
DEFAULTPATH
).
append
(
File
.
separator
)
;
if
(
id
<
1
)
{
if
(
id
<
1
)
{
EntityWrapper
<
Package
>
packagewrapper
=
new
EntityWrapper
<>();
EntityWrapper
<
Package
>
packagewrapper
=
new
EntityWrapper
<>();
packagewrapper
.
setSqlSelect
(
"max(id) as id"
);
packagewrapper
.
setSqlSelect
(
"max(id) as id"
);
List
<
Map
<
String
,
Object
>>
selectMaps
=
packageMapper
.
selectMaps
(
packagewrapper
);
List
<
Map
<
String
,
Object
>>
selectMaps
=
packageMapper
.
selectMaps
(
packagewrapper
);
id
=
Integer
.
parseInt
(
selectMaps
.
get
(
0
).
get
(
"id"
).
toString
());
basePath
.
append
(
Integer
.
parseInt
(
selectMaps
.
get
(
0
).
get
(
"id"
).
toString
())
+
1
);
Integer
fileid
=
id
+
1
;
subfix
=
fileid
.
toString
();
}
else
{
}
else
{
subfix
=
String
.
valueOf
(
id
);
basePath
.
append
(
id
);
}
}
backgroundpath
=
backgroundpath
+
subfix
.
replace
(
"."
,
""
).
File
dir
=
new
File
(
basePath
.
toString
());
replace
(
"/"
,
""
).
replace
(
"\\"
,
""
);
File
dir
=
new
File
(
backgroundpath
);
if
(!
dir
.
exists
())
{
if
(!
dir
.
exists
())
{
dir
.
mkdirs
();
dir
.
mkdirs
();
}
}
...
...
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