fix: cannot close account #22

This commit is contained in:
BaoXuebin 2022-07-23 12:20:28 +08:00
parent 517cb25e73
commit 506e606591
1 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ func CloseAccount(c *gin.Context) {
ledgerConfig := script.GetLedgerConfigFromContext(c) ledgerConfig := script.GetLedgerConfigFromContext(c)
line := fmt.Sprintf("%s close %s", accountForm.Date, accountForm.Account) line := fmt.Sprintf("%s close %s", accountForm.Date, accountForm.Account)
// 写入文件 // 写入文件
filePath := ledgerConfig.DataPath + "/account/" + script.GetAccountPrefix(accountForm.Account) + ".bean" filePath := ledgerConfig.DataPath + "/account/" + strings.ToLower(script.GetAccountPrefix(accountForm.Account)) + ".bean"
err := script.AppendFileInNewLine(filePath, line) err := script.AppendFileInNewLine(filePath, line)
if err != nil { if err != nil {
InternalError(c, err.Error()) InternalError(c, err.Error())
@ -197,7 +197,7 @@ func ChangeAccountIcon(c *gin.Context) {
filePath := "./public/icons/" + script.GetAccountIconName(account) + ".png" filePath := "./public/icons/" + script.GetAccountIconName(account) + ".png"
if err := c.SaveUploadedFile(file, filePath); err != nil { if err := c.SaveUploadedFile(file, filePath); err != nil {
InternalError(c, err.Error()) InternalError(c, err.Error())
//自己完成信息提示 // 自己完成信息提示
return return
} }
var result = make(map[string]string) var result = make(map[string]string)