From 668ac7019b9bfc027d7dfa6dabedceded67f4b18 Mon Sep 17 00:00:00 2001 From: Junvary Date: Fri, 23 Oct 2020 16:08:50 +0800 Subject: [PATCH 1/7] Update cors.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 多了一个转义,后端跨域不生效 --- server/middleware/cors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") From d564e80b24ce41dacdf18efcfed6340b055217a7 Mon Sep 17 00:00:00 2001 From: Beck Qin Date: Mon, 26 Oct 2020 09:27:52 +0800 Subject: [PATCH 2/7] jwt.go: fix localStorage spell error --- server/middleware/jwt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/middleware/jwt.go b/server/middleware/jwt.go index 6b72c53c..aa7b1d20 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{ From 1a50f87495eed35f739290a3bab09879d2114609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AD=90=E6=81=92?= Date: Mon, 26 Oct 2020 20:15:30 +0800 Subject: [PATCH 3/7] Update jwt.go --- server/middleware/jwt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/middleware/jwt.go b/server/middleware/jwt.go index 6b72c53c..f7c57171 100644 --- a/server/middleware/jwt.go +++ b/server/middleware/jwt.go @@ -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}) //当之前的取成功时才进行拉黑操作 } // 无论如何都要记录当前的活跃状态 From b396443f2b9097dc1f62073564743c649975f3b0 Mon Sep 17 00:00:00 2001 From: QM303176530 <303176530@qq.com> Date: Sat, 31 Oct 2020 00:08:05 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=BE=8E=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/template/fe/table.vue.tpl | 2 +- web/src/style/main.scss | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 }}