Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
梁杰芳
slm-fileview
Commits
b2f6fb3a
Commit
b2f6fb3a
authored
Jan 22, 2021
by
范青锋
Committed by
kl
Jan 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复重复编码导致文档转图片预览失败的问题&编码规范
URLEncoder.encode(URLEncoder.encode(pdfFolder, uriEncoding).replaceAll("\+", "%20"), uriEncoding); 这里encode了两次,导致图片预览失败。
parent
996da086
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
FileHandlerService.java
...r/src/main/java/cn/keking/service/FileHandlerService.java
+3
-2
No files found.
server/src/main/java/cn/keking/service/FileHandlerService.java
View file @
b2f6fb3a
...
...
@@ -178,14 +178,15 @@ public class FileHandlerService {
String
pdfFolder
=
pdfName
.
substring
(
0
,
pdfName
.
length
()
-
4
);
String
urlPrefix
;
try
{
urlPrefix
=
baseUrl
+
URLEncoder
.
encode
(
URLEncoder
.
encode
(
pdfFolder
,
uriEncoding
).
replaceAll
(
"\\+"
,
"%20"
),
uriEncoding
);
urlPrefix
=
baseUrl
+
URLEncoder
.
encode
(
pdfFolder
,
uriEncoding
).
replaceAll
(
"\\+"
,
"%20"
);
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
error
(
"UnsupportedEncodingException"
,
e
);
urlPrefix
=
baseUrl
+
pdfFolder
;
}
if
(
imageCount
!=
null
&&
imageCount
>
0
)
{
for
(
int
i
=
0
;
i
<
imageCount
;
i
++)
for
(
int
i
=
0
;
i
<
imageCount
;
i
++)
{
imageUrls
.
add
(
urlPrefix
+
"/"
+
i
+
imageFileSuffix
);
}
return
imageUrls
;
}
try
{
...
...
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