diff --git a/server/middleware/cors.go b/server/middleware/cors.go index 91a5ef21..68f6651f 100644 --- a/server/middleware/cors.go +++ b/server/middleware/cors.go @@ -11,7 +11,7 @@ func Cors() gin.HandlerFunc { method := c.Request.Method origin := c.Request.Header.Get("Origin") c.Header("Access-Control-Allow-Origin", origin) - c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id\"") + c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id") c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS,DELETE,PUT") c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type") c.Header("Access-Control-Allow-Credentials", "true") diff --git a/server/middleware/jwt.go b/server/middleware/jwt.go index 6b72c53c..552f6760 100644 --- a/server/middleware/jwt.go +++ b/server/middleware/jwt.go @@ -16,7 +16,7 @@ import ( func JWTAuth() gin.HandlerFunc { return func(c *gin.Context) { - // 我们这里jwt鉴权取头部信息 x-token 登录时回返回token信息 这里前端需要把token存储到cookie或者本地localSstorage中 不过需要跟后端协商过期时间 可以约定刷新令牌或者重新登录 + // 我们这里jwt鉴权取头部信息 x-token 登录时回返回token信息 这里前端需要把token存储到cookie或者本地localStorage中 不过需要跟后端协商过期时间 可以约定刷新令牌或者重新登录 token := c.Request.Header.Get("x-token") if token == "" { response.Result(response.ERROR, gin.H{ @@ -66,7 +66,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}) //当之前的取成功时才进行拉黑操作 } // 无论如何都要记录当前的活跃状态 diff --git a/server/resource/template/fe/table.vue.tpl b/server/resource/template/fe/table.vue.tpl index 789b04ac..290b965c 100644 --- a/server/resource/template/fe/table.vue.tpl +++ b/server/resource/template/fe/table.vue.tpl @@ -67,7 +67,7 @@ {{ end }}