diff --git a/bootstrap/model.go b/bootstrap/model.go index e72b4062..8cf4d344 100644 --- a/bootstrap/model.go +++ b/bootstrap/model.go @@ -89,13 +89,13 @@ func initAccounts() { if err := conf.DB.Find(&accounts).Error; err != nil { log.Fatalf("failed sync init accounts") } - for _, account := range accounts { + for i, account := range accounts { model.RegisterAccount(account) driver, ok := drivers.GetDriver(account.Type) if !ok { log.Errorf("no [%s] driver", driver) } else { - err := driver.Save(&account, nil) + err := driver.Save(&accounts[i], nil) if err != nil { log.Errorf("init account [%s] error:[%s]", account.Name, err.Error()) }