Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
legobackend
/
lego-manage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
6ef5a1a3
authored
2025-08-10 15:08:24 +0800
by
chentao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
加密资源
1 parent
b397102b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
lego-admin/src/main/java/com/lego/web/controller/core/CourseController.java
lego-system/src/main/java/com/lego/system/service/impl/SysOssServiceImpl.java
lego-admin/src/main/java/com/lego/web/controller/core/CourseController.java
View file @
6ef5a1a
This diff is collapsed.
Click to expand it.
lego-system/src/main/java/com/lego/system/service/impl/SysOssServiceImpl.java
View file @
6ef5a1a
...
...
@@ -210,13 +210,14 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
OssClient
storage
=
OssFactory
.
instance
();
UploadResult
uploadResult
;
try
{
if
(
".pdf"
.
equals
(
suffix
)
||
".mp4"
.
equals
(
suffix
)
||
".json"
.
equals
(
suffix
)
||
".ldr"
.
equals
(
suffix
))
{
byte
[]
encryptBytes
=
EncryptUtils
.
encryptByAes
(
file
.
getBytes
());
uploadResult
=
storage
.
uploadSuffix
(
encryptBytes
,
suffix
,
file
.
getContentType
());
}
else
{
// if(".pdf".equals(suffix) || ".mp4".equals(suffix) || ".json".equals(suffix) || ".ldr".equals(suffix)) {
// byte[] encryptBytes = EncryptUtils.encryptByAes(file.getBytes());
// uploadResult = storage.uploadSuffix(encryptBytes, suffix, file.getContentType());
// }
// else{
// uploadResult = storage.upload(file.getBytes(), originalfileName, file.getContentType());
// }
uploadResult
=
storage
.
upload
(
file
.
getBytes
(),
originalfileName
,
file
.
getContentType
());
}
}
catch
(
IOException
e
)
{
throw
new
ServiceException
(
e
.
getMessage
());
}
...
...
@@ -258,7 +259,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
return
vo
;
}
p
rivate
SysOssVo
buildResultEntity
(
String
originalfileName
,
String
suffix
,
String
configKey
,
UploadResult
uploadResult
)
{
p
ublic
SysOssVo
buildResultEntity
(
String
originalfileName
,
String
suffix
,
String
configKey
,
UploadResult
uploadResult
)
{
SysOss
oss
=
new
SysOss
();
oss
.
setUrl
(
uploadResult
.
getUrl
());
oss
.
setFileSuffix
(
suffix
);
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment