Order订单待测试

This commit is contained in:
eson
2023-06-20 19:36:28 +08:00
parent d4d11db732
commit e50dac6b1c
18 changed files with 116 additions and 43 deletions

View File

@@ -23,7 +23,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
}
}
func (svcCxt *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
func (svcCtx *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
AuthKey := r.Header.Get("Authorization")
if AuthKey == "" {
return nil, nil
@@ -35,7 +35,7 @@ func (svcCxt *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, err
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
}
// 返回用于验证签名的密钥
return []byte(svcCxt.Config.Auth.AccessSecret), nil
return []byte(svcCtx.Config.Auth.AccessSecret), nil
})
if err != nil {
return nil, errors.New(fmt.Sprint("Error parsing token:", err))