2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: 用户支持开启2FA

This commit is contained in:
2025-05-14 19:04:03 +08:00
parent 462d6c0789
commit 5fd00acd48
15 changed files with 476 additions and 88 deletions

View File

@@ -76,6 +76,16 @@ func (r *userRepo) UpdatePassword(id uint, password string) error {
return r.db.Save(user).Error
}
func (r *userRepo) UpdateEmail(id uint, email string) error {
user, err := r.Get(id)
if err != nil {
return err
}
user.Email = email
return r.db.Save(user).Error
}
func (r *userRepo) Delete(id uint) error {
if id == 1 {
return errors.New(r.t.Get("please don't do this"))