diff options
| author | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-03-23 22:52:50 +0300 |
|---|---|---|
| committer | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-03-23 22:52:50 +0300 |
| commit | 5ef8a5a37ec7e6b7df710fa61b0324ab5a6617ab (patch) | |
| tree | 8356d79072560de703f6dbc1d26fa5d51a6d5ac1 /web/controller/index.go | |
| parent | c49a9e877cb8481a98564b45f3462f8f73189f6e (diff) | |
old designv1.0.9
Diffstat (limited to 'web/controller/index.go')
| -rw-r--r-- | web/controller/index.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/controller/index.go b/web/controller/index.go index b4f981e8..71a1a34a 100644 --- a/web/controller/index.go +++ b/web/controller/index.go @@ -4,6 +4,7 @@ import ( "net/http" "time" "x-ui/logger" + "x-ui/web/job" "x-ui/web/service" "x-ui/web/session" @@ -19,7 +20,6 @@ type IndexController struct { BaseController userService service.UserService - tgbot service.Tgbot } func NewIndexController(g *gin.RouterGroup) *IndexController { @@ -60,13 +60,13 @@ func (a *IndexController) login(c *gin.Context) { user := a.userService.CheckUser(form.Username, form.Password) timeStr := time.Now().Format("2006-01-02 15:04:05") if user == nil { - a.tgbot.UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 0) + job.NewStatsNotifyJob().UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 0) logger.Infof("wrong username or password: \"%s\" \"%s\"", form.Username, form.Password) pureJsonMsg(c, false, I18n(c, "pages.login.toasts.wrongUsernameOrPassword")) return } else { logger.Infof("%s login success,Ip Address:%s\n", form.Username, getRemoteIp(c)) - a.tgbot.UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 1) + job.NewStatsNotifyJob().UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 1) } err = session.SetLoginUser(c, user) |
