From f8e3df36c82dc6cb7e7b786f1274d983154d9c6f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 9 Dec 2024 00:36:09 +0800 Subject: [PATCH] Update file.py --- web/utils/file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/utils/file.py b/web/utils/file.py index 582898353..885834732 100644 --- a/web/utils/file.py +++ b/web/utils/file.py @@ -141,6 +141,7 @@ def uncompress(sfile, dfile, path): return mw.returnData(False, '文件解压失败!:' + str(e)) def setBatchData(path, stype, access, user, data): + from admin import session if stype == '1' or stype == '2': session['selected'] = { 'path': path, @@ -154,7 +155,7 @@ def setBatchData(path, stype, access, user, data): for key in json.loads(data): try: filename = path + '/' + key - if not self.checkDir(filename): + if not checkDir(filename): return mw.returnData(False, 'FILE_DANGER') os.system('chmod -R ' + access + " '" + filename + "'") os.system('chown -R ' + user + ':' + user + " '" + filename + "'")