Skip to content

Commit

Permalink
Merge pull request #641 from midoks/dev
Browse files Browse the repository at this point in the history
修复站点备份目录未指定默认值
  • Loading branch information
midoks authored Dec 14, 2024
2 parents 80c1c0b + 9d08b7d commit de351c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit de351c7

Please sign in to comment.