Revert "pointChange"

This reverts commit fb4dba161619c043b8acd4971eac5433eb6630ab.
This commit is contained in:
songzhibin97
2020-11-23 12:02:18 +08:00
parent 1ddd6dac4f
commit 8e87ae55a9
31 changed files with 114 additions and 111 deletions
+2 -2
View File
@@ -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)
+3 -3
View File
@@ -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))
}
}