修复验证错误的问题, 验证allmodels的使用

This commit is contained in:
eson 2023-06-21 12:29:28 +08:00
parent 4fb57e1c39
commit 152e18b0e5
2 changed files with 2 additions and 2 deletions

View File

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

View File

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