mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-21 16:25:49 +00:00
1.optimize Tg bot notify info
2.fixed a bug when ParseIn twith Tg bot chat id
This commit is contained in:
@@ -58,14 +58,15 @@ func (a *IndexController) login(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
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)
|
||||
logger.Infof("wrong username or password: \"%s\" \"%s\"", form.Username, form.Password)
|
||||
pureJsonMsg(c, false, "用户名或密码错误")
|
||||
return
|
||||
} else {
|
||||
timeStr := time.Now().Format("2006-01-02 15:04:05")
|
||||
logger.Infof("%s login success,Ip Address:%s\n", form.Username, getRemoteIp(c))
|
||||
job.NewStatsNotifyJob().UserLoginNotify(form.Username, getRemoteIp(c), timeStr)
|
||||
job.NewStatsNotifyJob().UserLoginNotify(form.Username, getRemoteIp(c), timeStr, 1)
|
||||
}
|
||||
|
||||
err = session.SetLoginUser(c, user)
|
||||
|
||||
Reference in New Issue
Block a user