提交 c03d7a18 编写于 作者: 青阳龙野's avatar 青阳龙野

update to v1.0.19-release

上级 33eefd54
无法预览此类型文件
......@@ -77,11 +77,20 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
> 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。
### 新版本v1.0.18
_本次更新提供更加完善的数据传输保护机制,进一步满足在公共复杂网络环境下的使用需求。推荐所有用户升级体验。_
+ 登录验证码机制——当某一账户发生一次及以上的密码输入错误情况后,该账户的后续密码输入尝试均必须经由随机生成的验证码进行验证,直至该账户的密码输入正确。该设计旨在防止账户的密码被暴力破解,以确保在公共网络环境下使用的安全性。
+ https访问支持——新版本提供了对https协议的支持。这是目前运用最为广泛、技术最为成熟的数据传输安全解决方案,允许用户使用更加安全的https协议进行访问和操作,确保在公共网络环境下用户和服务器之间的数据传输安全,防止数据被窃取或篡改。开启及设置方法请见《kiftd说明文档》。
+ 修复了当文件名称中存在单引号时无法对其进行操作的BUG。
### 新版本v1.0.19
_本次更新增加了一些用户期待的新功能,并对已知的问题进行了修复,进一步增强kiftd的使用体验。推荐所有用户升级。_
+ 上传文件体积限制功能现已加入!该功能允许您为每个用户(或所有用户)单独设置其上传文件的最大体积限制,从而更加灵活地管理上传配额。设置方法详见随程序附带的《kiftd说明文档》。
+ 可自定义的登录验证码类型。现在,您可以根据需要自由选择登录验证码的类型,包括“标准(较难识别)”、“简化(容易识别)”和“关闭(不需要验证码)”三种,以便适应不同的使用环境和安全性需求。
+ 升级了内置JAVE视频解码引擎的版本:解决了其在Windows 32位操作系统下无法正确运行的BUG,同时降低了解码时的内存占用,并使其能够兼容Java 9+。
+ 放宽文件夹名称的长度限制至128个字符,方便用户使用更长的名称命名文件夹。
+ 增加浏览文件夹路径记忆功能——当您刷新页面或是打开新的kiftd页面时,文件列表将会重新显示您之前正在浏览的文件夹。
+ 进一步完善了文件夹视图系统:当用户试图打开一个不存在的文件夹时,将直接返回根目录。
+ 进一步优化了文件管理界面:当您使用拖拽的方法导入文件时,能够显示导入进度。
+ 优化MySQL配置检查机制:当MySQL连接失败时,系统不再将“mysql.enable”一项的值自动重置为“false”,从而避免用户误操作的情况发生。
+ 修复了当文件名存在特殊符号时,其下载链接无法被服务器正确解析的问题。
+ 修复了上传、视频播放和音乐播放过程中,因用户凭证失效可能导致操作被中断问题。
+ 修复了使用预览功能打开空的Word或TXT文档时无法正确显示的问题。
+ 修复了一个可能导致文件列表被HTML或JS代码注入的漏洞(特别鸣谢:GitHub用户“showuon”)。
> 需要查看更多版本历史信息?请访问: https://kohgylw.gitee.io/News.html
......
......@@ -23,6 +23,7 @@ var pvl;// 预览图片列表的JSON格式对象
var checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:<br /><br /><kbd>单击</kbd>:选中某一文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>单击</kbd></kbd>:选中多个文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>双击</kbd></kbd>:选中连续的文件<br /><br /><kbd><kbd>Shitf</kbd>+<kbd>A</kbd></kbd>:选中/取消选中所有文件";// 选取文件提示
var winHeight;// 窗口高度
var uploadKey;// 上传所用的一次性密钥
var pingInt;// 定时应答器的定时装置
// 界面功能方法定义
// 页面初始化
......@@ -31,7 +32,13 @@ $(function() {
changeFilesTableStyle();
}
getServerOS();// 得到服务器操作系统信息
showFolderView("root");// 显示根节点页面视图
// 查询是否存在记忆路径,若有,则直接显示记忆路径的内容,否则显示ROOT根路径
var arr = document.cookie.match(new RegExp("(^| )folder_id=([^;]*)(;|$)"));
if (arr != null){
showFolderView(unescape(arr[2]));// 显示记忆路径页面视图
}else{
showFolderView("root");// 显示根节点页面视图
}
// 点击空白处取消选中文件(已尝试兼容火狐,请期待用户反馈,如不好使再改)
$(document).click(function(e) {
var filetable = $("#filetable")[0];
......@@ -49,6 +56,10 @@ $(function() {
ap.seek(0);
ap.pause();
}
if(pingInt != null){
window.clearInterval(pingInt);
pingInt = null;
}
});
// 关闭打包下载模态框自动停止计时
$('#downloadAllCheckedModal').on('hidden.bs.modal', function(e) {
......@@ -389,11 +400,17 @@ function showFolderView(fid,targetId) {
$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");
} else if (result == "mustLogin") {
window.location.href = "login.html";
} else if(result == "NOT_FOUND") {
document.cookie = "folder_id=" + escape("root");// 归位记忆路径
window.location.href="/";
} else if(result == "notAccess"){
document.cookie = "folder_id=" + escape("root");// 归位记忆路径
window.location.href="/";
} else {
folderView = eval("(" + result + ")");
locationpath = folderView.folder.folderId;
// 存储打开的文件夹路径至Cookie中,以便下次打开时直接显示
document.cookie = "folder_id=" + escape(locationpath);
parentpath = folderView.folder.folderParent;
constraintLevel=folderView.folder.folderConstraint;
screenedFoldrView=null;
......@@ -748,7 +765,7 @@ function showFolderTable(folderView) {
.each(
folderView.folderList,
function(n, f) {
f.folderName = f.folderName.replace('\'','&#39;');
f.folderName = f.folderName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
var folderRow = "<tr id='"+f.folderId+"' onclick='checkfile(event,"+'"'+f.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+f.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("
+ '"' + f.folderId + '"'
+ ")' class='btn btn-link btn-xs'>/"
......@@ -796,7 +813,7 @@ function showFolderTable(folderView) {
.each(
folderView.fileList,
function(n, fi) {
fi.fileName = fi.fileName.replace('\'','&#39;');
fi.fileName = fi.fileName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
+ fi.fileId + '"' + ")' ondblclick='checkConsFile(event,"+'"'+fi.fileId+'"'+")' id='" + fi.fileId
+ "' class='filerow'><td>" + fi.fileName
......@@ -944,7 +961,7 @@ function createfolder() {
var reg = new RegExp("[\/\|\\s\\\\\*\\<\\>\\?\\:\\&\\$" + '"' + "]+", "g");
if (fn.length == 0) {
showFolderAlert("提示:文件夹名称不能为空。");
} else if (fn.length > 20) {
} else if (fn.length > 128) {
showFolderAlert("提示:文件夹名称太长。");
} else if (!reg.test(fn) && fn.indexOf(".") != 0) {
$("#folderalert").removeClass("alert");
......@@ -1078,7 +1095,7 @@ function renameFolder(folderId) {
var reg = new RegExp("[\/\|\\s\\\\\*\\<\\>\\?\\:\\&\\$" + '"' + "]+", "g");
if (newName.length == 0) {
showRFolderAlert("提示:文件夹名称不能为空。");
} else if (newName.length > 20) {
} else if (newName.length > 128) {
showRFolderAlert("提示:文件夹名称太长。");
} else if (!reg.test(newName) && newName.indexOf(".") != 0) {
$("#newfolderalert").removeClass("alert");
......@@ -1190,8 +1207,14 @@ function checkUploadFile() {
$("#uploadFileAlert").removeClass("alert-danger");
$("#uploadFileAlert").text("");
var filenames = new Array();
var maxSize = 0;
var maxFileIndex = 0;
for (var i = 0; i < fs.length; i++) {
filenames[i] = fs[i].name.replace(/^.+?\\([^\\]+?)?$/gi, "$1");
if(fs[i].size > maxSize){
maxSize = fs[i].size;
maxFileIndex = i;
}
}
var namelist = JSON.stringify(filenames);
......@@ -1200,7 +1223,9 @@ function checkUploadFile() {
dataType : "text",
data : {
folderId : locationpath,
namelist : namelist
namelist : namelist,
maxSize : maxSize,
maxFileIndex : maxFileIndex
},
url : "homeController/checkUploadFile.ajax",
success : function(result) {
......@@ -1214,7 +1239,9 @@ function checkUploadFile() {
} else {
var resp=eval("("+result+")");
uploadKey=resp.uploadKey;
if(resp.checkResult == "hasExistsNames"){
if(resp.checkResult == "fileTooLarge"){
showUploadFileAlert("提示:文件["+resp.overSizeFile+"]的体积超过最大限制("+resp.maxUploadFileSize+"),无法开始上传");
}else if(resp.checkResult == "hasExistsNames"){
repeList=resp.pereFileNameList;
repeIndex=0;
selectFileUpLoadModelStart();
......@@ -1325,9 +1352,18 @@ function doupload(count) {
// 上面的三个参数分别是:事件名(指定名称)、回调函数、是否冒泡(一般是false即可)
xhr.send(fd);// 上传FormData对象
if(pingInt == null){
pingInt = setInterval("ping()",60000);// 上传中开始计时应答
}
// 上传结束后执行的回调函数
xhr.onloadend = function() {
// 停止应答计时
if(pingInt != null){
window.clearInterval(pingInt);
pingInt = null;
}
if (xhr.status === 200) {
// TODO 上传成功
var result = xhr.responseText;
......@@ -1396,7 +1432,7 @@ function showDownloadModel(fileId, fileName) {
$("#downloadFileName").text("提示:您确认要下载文件:[" + fileName + "]么?");
$("#downloadHrefBox").html("<span class='text-muted'>正在生成...</span>");
getDownloadFileId=fileId;
getDownloadFileName=fileName;
getDownloadFileName=fileName.replace("#","%23").replace("%","%25").replace("?","%3F");
$("#downloadFileBox")
.html(
"<button id='dlmbutton' type='button' class='btn btn-primary' onclick='dodownload("
......@@ -1931,6 +1967,9 @@ function deleteAllChecked() {
// 播放音乐
function playAudio(fileId) {
$('#audioPlayerModal').modal('show');
if(pingInt == null){
pingInt = setInterval("ping()",60000);// 播放中开始计时应答
}
if (ap == null) {
ap = new APlayer({
container : document.getElementById('aplayer'),
......@@ -1957,6 +1996,10 @@ function playAudio(fileId) {
dataType:'text',
success:function(result){
var ail=eval("("+result+")");
// 避免存在恶意标签注入在文件名中
for(var i=0;i<ail.as.length;i++){
ail.as[i].name=ail.as[i].name.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
}
ap.list.add(ail.as);
ap.list.switch(ail.index);
audio_play();
......@@ -1971,8 +2014,6 @@ function playAudio(fileId) {
// 关闭音乐播放器
function closeAudioPlayer() {
$('#audioPlayerModal').modal('hide');
ap.seek(0);
ap.pause();
}
// 切换按钮状态与
......@@ -2327,6 +2368,7 @@ function selectInCompletePath(keyworld){
} else if (result == "mustLogin") {
window.location.href = "login.html";
} else if(result == "notAccess"){
document.cookie = "folder_id=" + escape("root");
window.location.href="/";
} else {
folderView = eval("(" + result + ")");
......@@ -2381,4 +2423,28 @@ function getDownloadURL(){
$("#downloadHrefBox").html("<span class='text-muted'>获取失败,请检查网络状态或<a href='javascript:void(0);' onclick='getDownloadURL()'>点此</a>重新获取。</span>");
}
});
}
// 防止长耗时待机时会话超时的应答器,每分钟应答一次
function ping(){
$.ajax({
url:"homeController/ping.ajax",
type:"POST",
dataType:"text",
data:{},
success:function(result){
if(result != 'pong'){
if(pingInt != null){
window.clearInterval(pingInt);
pingInt = null;
}
}
},
error:function(){
if(pingInt != null){
window.clearInterval(pingInt);
pingInt = null;
}
}
});
}
\ No newline at end of file
此差异已折叠。
......@@ -3,10 +3,12 @@
*/
var tReq;
var tTimer;
var pingInt;
$(function() {
window.onresize = function(){
showCloseBtn();
}
pingInt = setInterval("ping()",60000);
var fileId = getFileId();
$
.ajax({
......@@ -19,7 +21,7 @@ $(function() {
success : function(result) {
if (result != "ERROR") {
f = eval("(" + result + ")");
$("#vname").text(f.fileName);
$("#vname").text(f.fileName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;'));
$("#vcreator").text(f.fileCreator);
$("#vcdate").text(f.fileCreationDate);
$("#vsize").text(f.fileSize);
......@@ -52,7 +54,7 @@ function getFileId() {
}
return "";
}
// 显示视信息并播放视频
// 显示视信息并播放视频
function playVideo() {
$("#playerbox")
.html(
......@@ -112,4 +114,22 @@ function showCloseBtn(){
}else{
$("#closeBtn").removeClass("hidden");
}
}
//防止播放视频时会话超时的应答器,每分钟应答一次
function ping(){
$.ajax({
url:"homeController/ping.ajax",
type:"POST",
dataType:"text",
data:{},
success:function(result){
if(result != 'pong'){
window.clearInterval(pingInt);
}
},
error:function(){
window.clearInterval(pingInt);
}
});
}
\ No newline at end of file
function getFileId(){var b,a=location.search;return-1!=a.indexOf("?")?(b=a.substr(1),strs=b.split("="),strs[1]):""}function playVideo(){$("#playerbox").html("<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'><source src='resourceController/getResource.do?fid="+f.fileId+"' type='video/mp4'></video>");var a=videojs("kiftplayer");a.ready(function(){this.play()})}function reMainPage(){null!=tReq&&tReq.abort(),null!=tTimer&&window.clearTimeout(tTimer),window.opener=null,window.open("","_self"),window.close()}function doTranscode(){tReq=$.ajax({url:"resourceController/getVideoTranscodeStatus.ajax",type:"POST",dataType:"text",data:{fileId:f.fileId},success:function(a){"FIN"==a?playVideo():"ERROR"==a?(alert("错误:请求失败,请刷新重试。"),reMainPage()):($("#transcodeProgress").text(a),tTimer=setTimeout("doTranscode()",500))},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})}function showCloseBtn(){var a=$(window).width();450>a?$("#closeBtn").addClass("hidden"):$("#closeBtn").removeClass("hidden")}var tReq,tTimer;$(function(){window.onresize=function(){showCloseBtn()};var fileId=getFileId();$.ajax({url:"homeController/playVideo.ajax",type:"POST",dataType:"text",data:{fileId:fileId},success:function(result){"ERROR"!=result?(f=eval("("+result+")"),$("#vname").text(f.fileName),$("#vcreator").text(f.fileCreator),$("#vcdate").text(f.fileCreationDate),$("#vsize").text(f.fileSize),"N"==f.needEncode?playVideo():($("#playerMassage").html("<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>"),doTranscode())):(alert("错误:无法定位要预览的文件或该操作未被授权。"),reMainPage())},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})});
\ No newline at end of file
function getFileId(){var b,a=location.search;return-1!=a.indexOf("?")?(b=a.substr(1),strs=b.split("="),strs[1]):""}function playVideo(){$("#playerbox").html("<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'><source src='resourceController/getResource.do?fid="+f.fileId+"' type='video/mp4'></video>");var a=videojs("kiftplayer");a.ready(function(){this.play()})}function reMainPage(){null!=tReq&&tReq.abort(),null!=tTimer&&window.clearTimeout(tTimer),window.opener=null,window.open("","_self"),window.close()}function doTranscode(){tReq=$.ajax({url:"resourceController/getVideoTranscodeStatus.ajax",type:"POST",dataType:"text",data:{fileId:f.fileId},success:function(a){"FIN"==a?playVideo():"ERROR"==a?(alert("错误:请求失败,请刷新重试。"),reMainPage()):($("#transcodeProgress").text(a),tTimer=setTimeout("doTranscode()",500))},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})}function showCloseBtn(){var a=$(window).width();450>a?$("#closeBtn").addClass("hidden"):$("#closeBtn").removeClass("hidden")}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&window.clearInterval(pingInt)},error:function(){window.clearInterval(pingInt)}})}var tReq,tTimer,pingInt;$(function(){window.onresize=function(){showCloseBtn()},pingInt=setInterval("ping()",6e4);var fileId=getFileId();$.ajax({url:"homeController/playVideo.ajax",type:"POST",dataType:"text",data:{fileId:fileId},success:function(result){"ERROR"!=result?(f=eval("("+result+")"),$("#vname").text(f.fileName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;")),$("#vcreator").text(f.fileCreator),$("#vcdate").text(f.fileCreationDate),$("#vsize").text(f.fileSize),"N"==f.needEncode?playVideo():($("#playerMassage").html("<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>"),doTranscode())):(alert("错误:无法定位要预览的文件或该操作未被授权。"),reMainPage())},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册