This commit is contained in:
wangchuxiao
2023-06-14 12:23:51 +08:00
parent bef052ed8c
commit e3b9b5a8cd
5 changed files with 276 additions and 276 deletions
+3 -2
View File
@@ -1,15 +1,16 @@
package tokenverify
import (
"testing"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/golang-jwt/jwt/v4"
"testing"
)
func Test_ParseToken(t *testing.T) {
config.Config.TokenPolicy.AccessSecret = "OpenIM_server"
claims1 := BuildClaims("123456", constant.AndroidPlatformStr, 10)
claims1 := BuildClaims("123456", constant.AndroidPadPlatformID, 10)
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims1)
tokenString, err := token.SignedString([]byte(config.Config.TokenPolicy.AccessSecret))
if err != nil {