Parcourir la source

feature(bug):不传token使用上次token问题

ZZH-wl il y a 2 ans
Parent
commit
5c5f13aa3d
2 fichiers modifiés avec 6 ajouts et 5 suppressions
  1. 5 2
      micro_gateway/config.toml
  2. 1 3
      rpcx-gateway/gateway.go

+ 5 - 2
micro_gateway/config.toml

@@ -1,4 +1,7 @@
 [logger]
-    path   = "./log"
+    path   = "./reqlog"
+    file = "reqlog"
     level  = "all"
-    stdout = false
+    stdout = false
+    rotateSize = "10M"
+    rotateBackupLimit = 1

+ 1 - 3
rpcx-gateway/gateway.go

@@ -98,9 +98,7 @@ func (g *Gateway) handler(r *http.Request, servicePath string) (meta map[string]
 
 	// 处理Auth
 	token := getRequestToken(r)
-	if token != "" {
-		xc.Auth(token)
-	}
+	xc.Auth(token)
 
 	if mediaType == gin.MIMEMultipartPOSTForm {
 		formValues, formFile, err := MultipartRequest2RpcxRequest(r)