修復了jwt非對稱加密問題

This commit is contained in:
Kynix Chen 2024-07-10 13:24:20 +08:00
parent 191ea5389e
commit 1655a50704

View File

@ -124,7 +124,7 @@ func GenToken(claims *TokenClaims) (string, error) {
}
// 生成token字串
tokenGenerator := jwt.NewWithClaims(jwt.SigningMethodHS256, tokenClaims)
tokenGenerator := jwt.NewWithClaims(jwt.SigningMethodRS256, tokenClaims)
token, err := tokenGenerator.SignedString(privKey) // 生成token
if err != nil {
return "", err