fix: 被禁用用户登陆BUG, fix #120
This commit is contained in:
parent
e8bfdeb7bd
commit
81520df35d
@ -141,6 +141,11 @@ func Authenticator(c *gin.Context) (interface{}, error) {
|
|||||||
user, role, e := loginVal.GetUser()
|
user, role, e := loginVal.GetUser()
|
||||||
if e == nil {
|
if e == nil {
|
||||||
_, _ = loginLog.Create()
|
_, _ = loginLog.Create()
|
||||||
|
|
||||||
|
if user.Status == "1" {
|
||||||
|
return nil, errors.New("用户已被禁用。")
|
||||||
|
}
|
||||||
|
|
||||||
return map[string]interface{}{"user": user, "role": role}, nil
|
return map[string]interface{}{"user": user, "role": role}, nil
|
||||||
} else {
|
} else {
|
||||||
loginLog.Status = "1"
|
loginLog.Status = "1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user