You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
337 B
19 lines
337 B
2 years ago
|
package token
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestGetToken(t *testing.T) {
|
||
|
tokenKey := "JssLx22bjQwnyqby"
|
||
|
token, uniqId, err := GetToken(tokenKey, &UserInfo{
|
||
|
UserId: 111,
|
||
|
UserType: "admin",
|
||
|
Permissions: []string{"user:search"},
|
||
|
})
|
||
|
fmt.Println(token)
|
||
|
fmt.Println(uniqId, err)
|
||
|
fmt.Println(Parse(tokenKey, token))
|
||
|
}
|