Commit 88d37b6a by WeiCong

优化资源访问限制

parent fc442dfa
......@@ -2,6 +2,7 @@ package org.sss.presentation.noui.filter;
import log.Log;
import log.LogFactory;
import org.apache.commons.io.IOUtils;
import org.sss.presentation.noui.jwt.RedisLoginInfo;
import org.sss.presentation.noui.util.RedisUtil;
import org.sss.presentation.noui.util.StringUtil;
......@@ -149,15 +150,9 @@ public class ResourceAccessFilter implements Filter {
ServletOutputStream out;
try {
out = response.getOutputStream();
int b = 0;
byte[] buffer = new byte[512];
while (b != -1) {
b = inputStream.read(buffer);
out.write(buffer, 0, b);
}
inputStream.close();
out.close();
out.flush();
IOUtils.copy(inputStream,out);
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(out);
} catch (IOException e) {
log.warn("Access Pdfs IOException");
}
......
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