mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-16 07:06:25 +08:00
feat: user manage api
This commit is contained in:
@@ -86,6 +86,9 @@ func DeleteUserById(id uint) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if old.IsAdmin() || old.IsGuest() {
|
||||
return errors.WithStack(errs.DeleteAdminOrGuest)
|
||||
}
|
||||
userCache.Del(old.Username)
|
||||
return errors.WithStack(db.Delete(&model.User{}, id).Error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user