作者 庄敏学

增加生成token

  1 +package service
  2 +
  3 +import (
  4 + "fmt"
  5 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
  6 + "testing"
  7 +)
  8 +
  9 +func TestAdminToken(t *testing.T) {
  10 + domain.JWTExpiresSecond = 3600 * 24 * 365
  11 + userAuth := &domain.UserAuth{
  12 + UserId: 3325567738895360,
  13 + CompanyId: 507,
  14 + Phone: "18559023318",
  15 + PlatformId: 28,
  16 + Name: "庄敏学",
  17 + AdminType: 2,
  18 + }
  19 + fmt.Println(userAuth.CreateAccessToken())
  20 +}
  21 +
  22 +func TestFontToken(t *testing.T) {
  23 + domain.JWTExpiresSecond = 3600 * 24 * 365
  24 + userAuth := &domain.UserAuth{
  25 + UserId: 3325567738895360,
  26 + CompanyId: 507,
  27 + Phone: "18559023318",
  28 + PlatformId: 29,
  29 + Name: "庄敏学",
  30 + AdminType: 2,
  31 + }
  32 + fmt.Println(userAuth.CreateAccessToken())
  33 +}