fix: User disabled can not work (#133)

---
Closes: #133
This commit is contained in:
lejianwen
2025-02-10 10:09:20 +08:00
parent 5224c31d61
commit 7d6bc2a74f
3 changed files with 21 additions and 3 deletions

View File

@@ -24,6 +24,14 @@ func AdminAuth() gin.HandlerFunc {
return
}
if !service.AllService.UserService.CheckUserEnable(user) {
c.JSON(401, gin.H{
"error": "Unauthorized",
})
c.Abort()
return
}
c.Set("curUser", user)
c.Set("token", token)
//如果时间小于1天,token自动续期