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:07:49 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-03-17 19:07:49 +0300
commit96786c94189f3d2f3f04c1915529c786228bdf42 (patch)
tree879085e09a3cd485f3246f46be907fe77eb84a1a /web/controller/index.go
parentbc56e637376142c370c31b17558fc3778a863bd2 (diff)
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)