pull/109/head
midoks 3 years ago
parent a482204e23
commit 53736f77fc
  1. 14
      class/core/files_api.py
  2. 3
      route/static/app/files.js

@ -362,7 +362,7 @@ done
# 检查是否为.user.ini # 检查是否为.user.ini
if path.find('.user.ini'): if path.find('.user.ini'):
os.system("chattr -i '" + path + "'") os.system("which chattr && chattr -i '" + path + "'")
try: try:
if os.path.exists('data/recycle_bin.pl'): if os.path.exists('data/recycle_bin.pl'):
if self.mvRecycleBin(path): if self.mvRecycleBin(path):
@ -746,9 +746,9 @@ done
return mw.returnJson(False, '文件压缩失败!') return mw.returnJson(False, '文件压缩失败!')
def unzip(self, sfile, dfile, stype, path): def unzip(self, sfile, dfile, stype, path):
if sfile.find(',') == -1:
if not os.path.exists(path + '/' + sfile): if not os.path.exists(sfile):
return mw.returnMsg(False, '指定文件不存在!') return mw.returnMsg(False, '指定文件不存在!')
try: try:
tmps = mw.getRunDir() + '/tmp/panelExec.log' tmps = mw.getRunDir() + '/tmp/panelExec.log'
@ -761,8 +761,8 @@ done
if not sfile: if not sfile:
continue continue
sfiles += " '" + sfile + "'" sfiles += " '" + sfile + "'"
os.system("cd " + path + " && tar -zxvf '" + sfiles + os.system("cd " + path + " && tar -zxvf " + sfiles +
"' -C " + dfile + " " + " > " + tmps + " 2>&1") " -C " + dfile + " > " + tmps + " 2>&1")
self.setFileAccept(dfile) self.setFileAccept(dfile)
mw.writeLog("文件管理", '文件解压成功!', (sfile, dfile)) mw.writeLog("文件管理", '文件解压成功!', (sfile, dfile))
return mw.returnJson(True, '文件解压成功!') return mw.returnJson(True, '文件解压成功!')
@ -776,7 +776,7 @@ done
# 检查是否为.user.ini # 检查是否为.user.ini
if path.find('.user.ini') >= 0: if path.find('.user.ini') >= 0:
os.system("chattr -i '" + path + "'") os.system("which chattr && chattr -i '" + path + "'")
try: try:
if os.path.exists('data/recycle_bin.pl'): if os.path.exists('data/recycle_bin.pl'):

@ -1178,7 +1178,6 @@ function unZip(fileName,type) {
if(type.length ==3){ if(type.length ==3){
var sfile = encodeURIComponent($("#sfile").val()); var sfile = encodeURIComponent($("#sfile").val());
var dfile = encodeURIComponent($("#dfile").val()); var dfile = encodeURIComponent($("#dfile").val());
var password = encodeURIComponent($("#unpass").val());
coding = $("select[name='coding']").val(); coding = $("select[name='coding']").val();
layer.closeAll(); layer.closeAll();
layer.msg(lan.files.unzip_the, {icon: 16,time: 0,shade: [0.3, '#000']}); 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.closeAll();
layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2}); layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2});
getFiles(path); getFiles(path);
}); },'json');
return return
} }

Loading…
Cancel
Save