修復了jwt非對稱加密問題
This commit is contained in:
parent
191ea5389e
commit
1655a50704
@ -124,7 +124,7 @@ func GenToken(claims *TokenClaims) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 生成token字串
|
// 生成token字串
|
||||||
tokenGenerator := jwt.NewWithClaims(jwt.SigningMethodHS256, tokenClaims)
|
tokenGenerator := jwt.NewWithClaims(jwt.SigningMethodRS256, tokenClaims)
|
||||||
token, err := tokenGenerator.SignedString(privKey) // 生成token
|
token, err := tokenGenerator.SignedString(privKey) // 生成token
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
Loading…
Reference in New Issue
Block a user