Revert "pointChange"
This reverts commit fb4dba161619c043b8acd4971eac5433eb6630ab.
This commit is contained in:
@@ -42,7 +42,7 @@ func JWTAuth() gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
if err, _ = service.FindUserByUuid(claims.UUID.String()); err != nil {
|
||||
_ = service.JsonInBlacklist(&model.JwtBlacklist{Jwt: token})
|
||||
_ = service.JsonInBlacklist(model.JwtBlacklist{Jwt: token})
|
||||
response.FailWithDetailed(gin.H{"reload": true}, err.Error(), c)
|
||||
c.Abort()
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func JWTAuth() gin.HandlerFunc {
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("get redis jwt failed", zap.Any("err", err))
|
||||
} else { // 当之前的取成功时才进行拉黑操作
|
||||
_ = service.JsonInBlacklist(&model.JwtBlacklist{Jwt: RedisJwtToken})
|
||||
_ = service.JsonInBlacklist(model.JwtBlacklist{Jwt: RedisJwtToken})
|
||||
}
|
||||
// 无论如何都要记录当前的活跃状态
|
||||
_ = service.SetRedisJWT(newToken, newClaims.Username)
|
||||
|
||||
@@ -31,7 +31,7 @@ func OperationRecord() gin.HandlerFunc {
|
||||
if claims, ok := c.Get("claims"); ok {
|
||||
waitUse := claims.(*request.CustomClaims)
|
||||
userId = int(waitUse.ID)
|
||||
} else {
|
||||
}else {
|
||||
id, err := strconv.Atoi(c.Request.Header.Get("x-user-id"))
|
||||
if err != nil {
|
||||
userId = 0
|
||||
@@ -47,7 +47,7 @@ func OperationRecord() gin.HandlerFunc {
|
||||
UserID: userId,
|
||||
}
|
||||
values := c.Request.Header.Values("content-type")
|
||||
if len(values) > 0 && strings.Contains(values[0], "boundary") {
|
||||
if len(values) >0 && strings.Contains(values[0], "boundary") {
|
||||
record.Body = "file"
|
||||
}
|
||||
writer := responseBodyWriter{
|
||||
@@ -65,7 +65,7 @@ func OperationRecord() gin.HandlerFunc {
|
||||
record.Latency = latency
|
||||
record.Resp = writer.body.String()
|
||||
|
||||
if err := service.CreateSysOperationRecord(&record); err != nil {
|
||||
if err := service.CreateSysOperationRecord(record); err != nil {
|
||||
global.GVA_LOG.Error("create operation record error:", zap.Any("err", err))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user