Commit 60b2ef84 authored by liqin's avatar liqin 💬

bug fixed

parent adf431c2
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("加解密完成");
}
}
......@@ -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");
......
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment