|
|
@@ -182,15 +182,20 @@ func (ct *Login) Login(c *gin.Context) {
|
|
182
|
182
|
global.Logger.Warn(fmt.Sprintf("Login Fail: %s %s %s", "UsernameOrPasswordError", c.RemoteIP(), clientIp))
|
|
183
|
183
|
loginLimiter.RecordFailure(clientIp)
|
|
184
|
184
|
if loginLimiter.NeedsCaptcha(clientIp) {
|
|
185
|
|
- // 移除原验证码,重新生成
|
|
186
|
185
|
loginLimiter.RemoveCaptcha(clientIp)
|
|
187
|
|
- response.Fail(c, 110, response.TranslateMsg(c, "UsernameOrPasswordError"))
|
|
188
|
|
- return
|
|
189
|
186
|
}
|
|
190
|
187
|
response.Fail(c, 101, response.TranslateMsg(c, "UsernameOrPasswordError"))
|
|
191
|
188
|
return
|
|
192
|
189
|
}
|
|
193
|
190
|
|
|
|
191
|
+ if !service.AllService.UserService.CheckUserEnable(u) {
|
|
|
192
|
+ if loginLimiter.NeedsCaptcha(clientIp) {
|
|
|
193
|
+ loginLimiter.RemoveCaptcha(clientIp)
|
|
|
194
|
+ }
|
|
|
195
|
+ response.Fail(c, 101, response.TranslateMsg(c, "UserDisabled"))
|
|
|
196
|
+ return
|
|
|
197
|
+ }
|
|
|
198
|
+
|
|
194
|
199
|
ut := service.AllService.UserService.Login(u, &model.LoginLog{
|
|
195
|
200
|
UserId: u.Id,
|
|
196
|
201
|
Client: model.LoginLogClientWebAdmin,
|