Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
60b2ef84
Commit
60b2ef84
authored
3 years ago
by
liqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
adf431c2
master
1.0
dev
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
VideoEncryptUtil.java
...energy/chnmuseum/party/common/video/VideoEncryptUtil.java
+46
-0
ShiroConfig.java
...n/java/cn/wisenergy/chnmuseum/party/conf/ShiroConfig.java
+1
-0
AssetController.java
...nergy/chnmuseum/party/web/controller/AssetController.java
+6
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/video/VideoEncryptUtil.java
0 → 100644
View file @
60b2ef84
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
video
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.*
;
import
java.nio.charset.StandardCharsets
;
@Slf4j
public
class
VideoEncryptUtil
{
private
static
final
String
plainFilePath
=
"D:\\200.tmp\\"
;
//此为AES128位,如果要求AES256位,需要更新jdk内的包,jdk8发布版本默认不支持
private
static
final
String
cipher
=
"3348c95c60520be7"
;
private
static
final
int
dataLength
=
4096
;
public
static
void
main
(
InputStream
fis
,
String
cipher
)
throws
IOException
{
final
OutputStream
[]
outputStream
=
new
OutputStream
[
1
];
AesCipherDataSink
encryptingDataSink
=
new
AesCipherDataSink
(
"3348c95c60520be7"
.
getBytes
(
StandardCharsets
.
UTF_8
),
new
DataSink
()
{
@Override
public
void
open
()
{
outputStream
[
0
]
=
new
ByteArrayOutputStream
();
}
@Override
public
void
write
(
byte
[]
buffer
,
int
offset
,
int
length
)
throws
IOException
{
outputStream
[
0
].
write
(
buffer
,
offset
,
length
);
}
@Override
public
void
close
()
throws
IOException
{
outputStream
[
0
].
close
();
}
});
encryptingDataSink
.
open
();
int
len
;
byte
[]
buffer
=
new
byte
[
dataLength
];
while
((
len
=
fis
.
read
(
buffer
))
!=
-
1
)
{
encryptingDataSink
.
write
(
buffer
,
0
,
len
);
}
encryptingDataSink
.
close
();
fis
.
close
();
log
.
info
(
"加解密完成"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/wisenergy/chnmuseum/party/conf/ShiroConfig.java
View file @
60b2ef84
...
...
@@ -92,6 +92,7 @@ public class ShiroConfig {
filterChainDefinitionMap
.
put
(
"/ajaxLogin1"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/verifyCode1"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/loginByQrCode"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/doc.html"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/404"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/500"
,
"anon"
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AssetController.java
View file @
60b2ef84
...
...
@@ -81,9 +81,15 @@ public class AssetController extends BaseController {
@RequiresAuthentication
//@RequiresPermissions("asset:download")
public
void
download
(
@RequestParam
(
"idList"
)
List
<
String
>
idList
)
{
final
List
<
Asset
>
assetList
=
assetService
.
listByIds
(
idList
);
InputStream
[]
inputStreams
=
new
InputStream
[
idList
.
size
()];
for
(
Asset
asset
:
assetList
)
{
final
String
fileUrl
=
asset
.
getFileUrl
();
final
InputStream
inputStream
=
FastDFSUtils
.
downloadFile
(
fileUrl
);
}
}
...
...
This diff is collapsed.
Click to expand it.
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