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
ee6ff502
Commit
ee6ff502
authored
Jan 18, 2021
by
kl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解码url时,默认UTF-8编码
parent
196741d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
DownloadUtils.java
server/src/main/java/cn/keking/utils/DownloadUtils.java
+0
-1
OnlinePreviewController.java
...ava/cn/keking/web/controller/OnlinePreviewController.java
+2
-1
No files found.
server/src/main/java/cn/keking/utils/DownloadUtils.java
View file @
ee6ff502
...
@@ -4,7 +4,6 @@ import cn.keking.config.ConfigConstants;
...
@@ -4,7 +4,6 @@ import cn.keking.config.ConfigConstants;
import
cn.keking.model.FileAttribute
;
import
cn.keking.model.FileAttribute
;
import
cn.keking.model.ReturnResponse
;
import
cn.keking.model.ReturnResponse
;
import
io.mola.galimatias.GalimatiasParseException
;
import
io.mola.galimatias.GalimatiasParseException
;
import
jodd.io.FileUtil
;
import
jodd.io.NetUtil
;
import
jodd.io.NetUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
...
server/src/main/java/cn/keking/web/controller/OnlinePreviewController.java
View file @
ee6ff502
...
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.io.*
;
import
java.net.URL
;
import
java.net.URL
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
...
@@ -55,7 +56,7 @@ public class OnlinePreviewController {
...
@@ -55,7 +56,7 @@ public class OnlinePreviewController {
public
String
onlinePreview
(
String
url
,
Model
model
,
HttpServletRequest
req
)
{
public
String
onlinePreview
(
String
url
,
Model
model
,
HttpServletRequest
req
)
{
String
fileUrl
;
String
fileUrl
;
try
{
try
{
fileUrl
=
new
String
(
Base64
.
decodeBase64
(
url
));
fileUrl
=
new
String
(
Base64
.
decodeBase64
(
url
)
,
StandardCharsets
.
UTF_8
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
String
errorMsg
=
String
.
format
(
BASE64_DECODE_ERROR_MSG
,
"url"
);
String
errorMsg
=
String
.
format
(
BASE64_DECODE_ERROR_MSG
,
"url"
);
return
otherFilePreview
.
notSupportedFile
(
model
,
errorMsg
);
return
otherFilePreview
.
notSupportedFile
(
model
,
errorMsg
);
...
...
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