fix bug: bak file path

This commit is contained in:
BaoXuebin 2021-12-01 23:37:53 +08:00
parent b68bf11342
commit bdc4888a0c
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ func UpdateLedgerSourceFileContent(c *gin.Context) {
} }
sourceFilePath := ledgerConfig.DataPath + "/" + updateSourceFileForm.Path sourceFilePath := ledgerConfig.DataPath + "/" + updateSourceFileForm.Path
targetFilePath := ledgerConfig.DataPath + "/bak/" + time.Now().Format("20060102150405") + "_" + updateSourceFileForm.Path targetFilePath := ledgerConfig.DataPath + "/bak/" + time.Now().Format("20060102150405") + "_" + strings.ReplaceAll(updateSourceFileForm.Path, "/", "_")
// 备份数据 // 备份数据
if ledgerConfig.IsBak { if ledgerConfig.IsBak {
err := script.CopyFile(sourceFilePath, targetFilePath) err := script.CopyFile(sourceFilePath, targetFilePath)