🐛 fix native account status

This commit is contained in:
微凉 2021-11-16 18:23:59 +08:00
parent f87ee1ed9e
commit e5f8f59c87

View File

@ -38,6 +38,8 @@ func (n Native) Proxy(c *gin.Context) {
func (n Native) Save(account *model.Account, old *model.Account) error {
log.Debugf("save a account: [%s]", account.Name)
if !utils.Exists(account.RootFolder) {
account.Status = fmt.Sprintf("[%s] not exist", account.RootFolder)
_ = model.SaveAccount(account)
return fmt.Errorf("[%s] not exist", account.RootFolder)
}
account.Status = "work"