master
parent
9ad8b647c2
commit
8b2e767347
4 changed files with 7 additions and 26 deletions
@ -1,18 +0,0 @@ |
|||||||
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)) |
|
||||||
} |
|
@ -1,4 +1,4 @@ |
|||||||
package token |
package jwt |
||||||
|
|
||||||
import ( |
import ( |
||||||
"bytes" |
"bytes" |
@ -1,4 +1,4 @@ |
|||||||
package token |
package jwt |
||||||
|
|
||||||
import ( |
import ( |
||||||
"encoding/json" |
"encoding/json" |
Loading…
Reference in new issue