feat: do not access database before response return (close #158)

This commit is contained in:
JustSong
2023-06-21 17:26:26 +08:00
parent ba54c71948
commit 6d961064d2
3 changed files with 56 additions and 5 deletions

View File

@@ -100,7 +100,7 @@ func TokenAuth() func(c *gin.Context) {
c.Abort()
return
}
if !model.IsUserEnabled(token.UserId) {
if !model.CacheIsUserEnabled(token.UserId) {
c.JSON(http.StatusOK, gin.H{
"error": gin.H{
"message": "用户已被封禁",