diff --git a/class/core/files_api.py b/class/core/files_api.py index 4a5d70d19..5b7618aa9 100755 --- a/class/core/files_api.py +++ b/class/core/files_api.py @@ -362,7 +362,7 @@ done # 检查是否为.user.ini if path.find('.user.ini'): - os.system("chattr -i '" + path + "'") + os.system("which chattr && chattr -i '" + path + "'") try: if os.path.exists('data/recycle_bin.pl'): if self.mvRecycleBin(path): @@ -746,9 +746,9 @@ done return mw.returnJson(False, '文件压缩失败!') def unzip(self, sfile, dfile, stype, path): - if sfile.find(',') == -1: - if not os.path.exists(path + '/' + sfile): - return mw.returnMsg(False, '指定文件不存在!') + + if not os.path.exists(sfile): + return mw.returnMsg(False, '指定文件不存在!') try: tmps = mw.getRunDir() + '/tmp/panelExec.log' @@ -761,8 +761,8 @@ done if not sfile: continue sfiles += " '" + sfile + "'" - os.system("cd " + path + " && tar -zxvf '" + sfiles + - "' -C " + dfile + " " + " > " + tmps + " 2>&1") + os.system("cd " + path + " && tar -zxvf " + sfiles + + " -C " + dfile + " > " + tmps + " 2>&1") self.setFileAccept(dfile) mw.writeLog("文件管理", '文件解压成功!', (sfile, dfile)) return mw.returnJson(True, '文件解压成功!') @@ -776,7 +776,7 @@ done # 检查是否为.user.ini if path.find('.user.ini') >= 0: - os.system("chattr -i '" + path + "'") + os.system("which chattr && chattr -i '" + path + "'") try: if os.path.exists('data/recycle_bin.pl'): diff --git a/route/static/app/files.js b/route/static/app/files.js index 1a8a8ecbb..883450f2d 100755 --- a/route/static/app/files.js +++ b/route/static/app/files.js @@ -1178,7 +1178,6 @@ function unZip(fileName,type) { if(type.length ==3){ var sfile = encodeURIComponent($("#sfile").val()); var dfile = encodeURIComponent($("#dfile").val()); - var password = encodeURIComponent($("#unpass").val()); coding = $("select[name='coding']").val(); layer.closeAll(); layer.msg(lan.files.unzip_the, {icon: 16,time: 0,shade: [0.3, '#000']}); @@ -1186,7 +1185,7 @@ function unZip(fileName,type) { layer.closeAll(); layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2}); getFiles(path); - }); + },'json'); return }