diff --git a/web/controller/user.go b/web/controller/user.go index 6e3ccb07..dcbd3454 100644 --- a/web/controller/user.go +++ b/web/controller/user.go @@ -105,6 +105,18 @@ func (a *UserController) deleteUser(c *gin.Context) { } currentUser := session.GetLoginUser(c) + inbounds, err := a.inboundService.GetInbounds(id) + if err != nil { + jsonMsg(c, I18nWeb(c, "pages.users.toasts.delete"), err) + return + } + for _, inbound := range inbounds { + if _, err := a.inboundService.DelInbound(inbound.Id); err != nil { + jsonMsg(c, I18nWeb(c, "pages.users.toasts.delete"), err) + return + } + } + err = a.userService.DeleteUser(id, currentUser.Id) if err != nil { jsonMsg(c, I18nWeb(c, "pages.users.toasts.delete"), a.localizeUserError(c, err))