Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-03-17 19:30:14 +0300
committerGitHub <noreply@github.com>2023-03-17 19:30:14 +0300
commitf25a7a571e6103587558e970673a09375b1ef318 (patch)
tree24e645ff37cec8d8b166bfe59403c4fb19a1da2c /web/controller/index.go
parentb9ffe62d698016b52a5a36ede0eb2bdf86085d8a (diff)
parent87e173b56767a861210dc0cc4913bab232765dfd (diff)
Merge pull request #26 from MHSanaei/dev
alireza
Diffstat (limited to 'web/controller/index.go')
-rw-r--r--web/controller/index.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/controller/index.go b/web/controller/index.go
index 71a1a34a..b4f981e8 100644
--- a/web/controller/index.go
+++ b/web/controller/index.go
@@ -4,7 +4,6 @@ import (
"net/http"
"time"
"x-ui/logger"
- "x-ui/web/job"
"x-ui/web/service"
"x-ui/web/session"
@@ -20,6 +19,7 @@ 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 {
- job.NewStatsNotifyJob().UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 0)
+ a.tgbot.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))
- job.NewStatsNotifyJob().UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 1)
+ a.tgbot.UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 1)
}
err = session.SetLoginUser(c, user)