Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8798d344b6 | |||
| 63e62ab57b | |||
| 9a027674ac | |||
| e4407467dd |
@ -27,5 +27,5 @@ RUN yum install -y kde-l10n-Chinese &&\
|
|||||||
mkfontdir &&\
|
mkfontdir &&\
|
||||||
fc-cache -fv
|
fc-cache -fv
|
||||||
ENV LC_ALL zh_CN.UTF-8
|
ENV LC_ALL zh_CN.UTF-8
|
||||||
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-2.1.1/bin
|
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-2.1.2/bin
|
||||||
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-2.1.1/conf/application.properties","-jar","/opt/kkFileView-2.1.1/bin/kkFileView-2.1.1.jar"]
|
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-2.1.2/conf/application.properties","-jar","/opt/kkFileView-2.1.2/bin/kkFileView-2.1.2.jar"]
|
||||||
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<groupId>cn.keking</groupId>
|
<groupId>cn.keking</groupId>
|
||||||
<artifactId>kkFileView</artifactId>
|
<artifactId>kkFileView</artifactId>
|
||||||
<version>2.1.1</version>
|
<version>2.1.2</version>
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@ -4,4 +4,4 @@ cd "%KKFILEVIEW_BIN_FOLDER%"
|
|||||||
echo Using KKFILEVIEW_BIN_FOLDER %KKFILEVIEW_BIN_FOLDER%
|
echo Using KKFILEVIEW_BIN_FOLDER %KKFILEVIEW_BIN_FOLDER%
|
||||||
echo Starting kkFileView...
|
echo Starting kkFileView...
|
||||||
echo Please check log file for more information
|
echo Please check log file for more information
|
||||||
java -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=..\conf\application.properties -jar kkFileView-2.1.1.jar -> ..\log\kkFileView.log
|
java -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=..\conf\application.properties -jar kkFileView-2.1.2.jar -> ..\log\kkFileView.log
|
||||||
@ -27,4 +27,4 @@ else
|
|||||||
fi
|
fi
|
||||||
echo "Starting kkFileView..."
|
echo "Starting kkFileView..."
|
||||||
echo "Please check log file for more information"
|
echo "Please check log file for more information"
|
||||||
nohup java -Dfile.encoding=UTF-8 -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=../conf/application.properties -jar kkFileView-2.1.1.jar > ../log/kkFileView.log 2>&1 &
|
nohup java -Dfile.encoding=UTF-8 -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=../conf/application.properties -jar kkFileView-2.1.2.jar > ../log/kkFileView.log 2>&1 &
|
||||||
|
|||||||
@ -37,7 +37,19 @@ public class FileController {
|
|||||||
@RequestMapping(value = "fileUpload", method = RequestMethod.POST)
|
@RequestMapping(value = "fileUpload", method = RequestMethod.POST)
|
||||||
public String fileUpload(@RequestParam("file") MultipartFile file,
|
public String fileUpload(@RequestParam("file") MultipartFile file,
|
||||||
HttpServletRequest request) throws JsonProcessingException {
|
HttpServletRequest request) throws JsonProcessingException {
|
||||||
|
// 获取文件名
|
||||||
String fileName = file.getOriginalFilename();
|
String fileName = file.getOriginalFilename();
|
||||||
|
//判断是否为IE浏览器的文件名,IE浏览器下文件名会带有盘符信息
|
||||||
|
// Check for Unix-style path
|
||||||
|
int unixSep = fileName.lastIndexOf('/');
|
||||||
|
// Check for Windows-style path
|
||||||
|
int winSep = fileName.lastIndexOf('\\');
|
||||||
|
// Cut off at latest possible point
|
||||||
|
int pos = (winSep > unixSep ? winSep : unixSep);
|
||||||
|
if (pos != -1) {
|
||||||
|
fileName = fileName.substring(pos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
// 判断该文件类型是否有上传过,如果上传过则提示不允许再次上传
|
// 判断该文件类型是否有上传过,如果上传过则提示不允许再次上传
|
||||||
if (existsTypeFile(fileName)) {
|
if (existsTypeFile(fileName)) {
|
||||||
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(1, "每一种类型只可以上传一个文件,请先删除原有文件再次上传", null));
|
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(1, "每一种类型只可以上传一个文件,请先删除原有文件再次上传", null));
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
function isInSight(el) {
|
function isInSight(el) {
|
||||||
const bound = el.getBoundingClientRect();
|
var bound = el.getBoundingClientRect();
|
||||||
const clientHeight = window.innerHeight;
|
var clientHeight = window.innerHeight;
|
||||||
//只考虑向下滚动加载
|
//只考虑向下滚动加载
|
||||||
//const clientWidth=window.innerWeight;
|
//const clientWidth=window.innerWeight;
|
||||||
return bound.top <= clientHeight + 100;
|
return bound.top <= clientHeight + 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
let index = 0;
|
var index = 0;
|
||||||
|
|
||||||
function checkImgs() {
|
function checkImgs() {
|
||||||
const imgs = document.querySelectorAll('.my-photo');
|
var imgs = document.querySelectorAll('.my-photo');
|
||||||
for (let i = index; i < imgs.length; i++) {
|
for (var i = index; i < imgs.length; i++) {
|
||||||
if (isInSight(imgs[i])) {
|
if (isInSight(imgs[i])) {
|
||||||
loadImg(imgs[i]);
|
loadImg(imgs[i]);
|
||||||
index = i;
|
index = i;
|
||||||
@ -18,24 +19,47 @@ function checkImgs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadImg(el) {
|
function loadImg(el) {
|
||||||
const source = el.dataset.src;
|
var source = el.getAttribute("data-src");
|
||||||
el.src = source;
|
el.src = source;
|
||||||
}
|
}
|
||||||
|
// var mustRun = 500
|
||||||
|
// function throttle(fn, mustRun) {
|
||||||
|
// var timer = null;
|
||||||
|
// var previous = null;
|
||||||
|
// return function() {
|
||||||
|
// var now = new Date();
|
||||||
|
// var context = this;
|
||||||
|
// var args = arguments;
|
||||||
|
// if (!previous) {
|
||||||
|
// previous = now;
|
||||||
|
// }
|
||||||
|
// var remaining = now - previous;
|
||||||
|
// if (mustRun && remaining >= mustRun) {
|
||||||
|
// fn.apply(context, args);
|
||||||
|
// previous = now;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
function throttle(fn, mustRun = 500) {
|
|
||||||
const timer = null;
|
function throttle(fn) {
|
||||||
let previous = null;
|
var timer = null;
|
||||||
return function() {
|
var previous = null;
|
||||||
const now = new Date();
|
return function () {
|
||||||
const context = this;
|
var now = new Date();
|
||||||
const args = arguments;
|
var context = this;
|
||||||
|
var args = arguments;
|
||||||
if (!previous) {
|
if (!previous) {
|
||||||
previous = now;
|
previous = now;
|
||||||
}
|
}
|
||||||
const remaining = now - previous;
|
var remaining = now - previous;
|
||||||
if (mustRun && remaining >= mustRun) {
|
setTimeout(refresh(fn, remaining, context, args, previous, now));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function refresh(fn, remaining, context, args, previous, now) {
|
||||||
|
if (remaining >= 500) {
|
||||||
fn.apply(context, args);
|
fn.apply(context, args);
|
||||||
previous = now;
|
previous = now;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1897,7 +1897,7 @@ var validateFileURL = void 0;
|
|||||||
}
|
}
|
||||||
var fileOrigin = new URL(file, window.location.href).origin;
|
var fileOrigin = new URL(file, window.location.href).origin;
|
||||||
if (fileOrigin !== viewerOrigin) {
|
if (fileOrigin !== viewerOrigin) {
|
||||||
return '/getCorsFile?urlPath=' + file;
|
return '/getCorsFile?urlPath=' + encodeURIComponent(file);
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
var message = ex && ex.message;
|
var message = ex && ex.message;
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>cn.keking</groupId>
|
<groupId>cn.keking</groupId>
|
||||||
<artifactId>filepreview</artifactId>
|
<artifactId>filepreview</artifactId>
|
||||||
<version>2.1.1</version>
|
<version>2.1.2</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>jodconverter-core</module>
|
<module>jodconverter-core</module>
|
||||||
<module>jodconverter-web</module>
|
<module>jodconverter-web</module>
|
||||||
|
|||||||
Reference in New Issue
Block a user