Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复站点备份目录未指定默认值 #641

Merged
merged 3 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/core/mw.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def getWwwDir():

def getBackupDir():
import thisdb
backup_path = thisdb.getOption('backup_path')
backup_path = thisdb.getOption('backup_path', default=getFatherDir()+'/backup')
return backup_path

def setBackupDir(bdir):
Expand Down
10 changes: 8 additions & 2 deletions web/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,19 @@ def mvFile(sfile, dfile):
if not checkDir(sfile):
return mw.returnData(False, 'FILE_DANGER')


try:
pass
except Exception as e:
raise e

try:
shutil.move(sfile, dfile)
msg = mw.getInfo('移动或重名命文件[{1}]到[{2}]成功!', (sfile, dfile,))
mw.writeLog('文件管理', msg)
return mw.returnData(True, '移动或重名命文件成功!')
except:
return mw.returnData(False, '移动或重名命文件失败!')
except Exception as e:
return mw.returnData(False, '移动或重名命文件失败!'+str(e))

def uncompress(sfile, dfile, path):
if not os.path.exists(sfile):
Expand Down
Loading