Browse Source

解决JWT问题

lijian 1 year ago
parent
commit
45ddba8dd7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      services/apiprovider/actions.go

+ 3 - 2
services/apiprovider/actions.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"encoding/json"
 	"errors"
+	"fmt"
 	"github.com/gogf/gf/encoding/gjson"
 	"sparrow/pkg/productconfig"
 	"sparrow/pkg/rpcs"
@@ -355,14 +356,14 @@ func AppAuth(req *http.Request, r render.Render) {
 	}
 
 	app := &models.Application{}
-
+	fmt.Println("+++++++++++++++++++++++++")
 	err = server.RPCCallByName(nil, rpcs.RegistryServerName, "Registry.FindApplicationByAppKey", ruleReq, app)
 	if err != nil {
 
 		r.JSON(http.StatusOK, renderError(ErrWrongSecret, errors.New("invalid secret key")))
 		return
 	}
-
+	fmt.Println("---------")
 	if app.SecretKey != ruleReq.Secretkey {
 		// device secret is wrong.
 		r.JSON(http.StatusOK, renderError(ErrWrongSecret, errors.New("wrong application secret")))