package utils import ( "git.hilo.cn/hilo-common/script/utils/jwt" "testing" ) func TestTestCommon(t *testing.T) { TestCommon() } func TestJwt(t *testing.T) { token, _ := jwt.GenerateToken(4051, "96f6c25208a346b8871d5ef1a74a7fe3", "hiloApi") t.Logf(token) } func TestJwtParse(t *testing.T) { c, _ := jwt.ParseToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjg4Nzc2OTEsIkV4dGVybmFsSWQiOiJkNmZlNmJhN2E3ZTI0NjRiYjhhNmU3OTFlNmQxY2E5ZCIsIlRva2VuVmVyc2lvbiI6NywiZXhwIjoxNzE5NTczOTkzLCJpc3MiOiJoaWxvQXBpIn0.EWSFvxzyPDRLWA5eNQ_MSrUDlAeoMhmn0RKw4vfvL6k") println(c.UserId) }