fix: 被禁用用户登陆BUG, fix #120

This commit is contained in:
Mr. Lan 2020-12-27 19:58:32 +08:00
parent e8bfdeb7bd
commit 81520df35d

View File

@ -141,6 +141,11 @@ func Authenticator(c *gin.Context) (interface{}, error) {
user, role, e := loginVal.GetUser()
if e == nil {
_, _ = loginLog.Create()
if user.Status == "1" {
return nil, errors.New("用户已被禁用。")
}
return map[string]interface{}{"user": user, "role": role}, nil
} else {
loginLog.Status = "1"