正在显示
3 个修改的文件
包含
14 行增加
和
14 行删除
| @@ -29,11 +29,11 @@ func dayEndTime(t time.Time) time.Time { | @@ -29,11 +29,11 @@ func dayEndTime(t time.Time) time.Time { | ||
| 29 | return t2 | 29 | return t2 |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | -func dayZeroTime(t time.Time) time.Time { | ||
| 33 | - y, m, d := t.Local().Date() | ||
| 34 | - t2 := time.Date(y, m, d, 0, 0, 0, 0, time.Local) | ||
| 35 | - return t2 | ||
| 36 | -} | 32 | +// func dayZeroTime(t time.Time) time.Time { |
| 33 | +// y, m, d := t.Local().Date() | ||
| 34 | +// t2 := time.Date(y, m, d, 0, 0, 0, 0, time.Local) | ||
| 35 | +// return t2 | ||
| 36 | +// } | ||
| 37 | 37 | ||
| 38 | func (srv TaskService) CreateTaskTest(param *command.CreateTaskCommand) error { | 38 | func (srv TaskService) CreateTaskTest(param *command.CreateTaskCommand) error { |
| 39 | transactionContext, err := factory.CreateTransactionContext(nil) | 39 | transactionContext, err := factory.CreateTransactionContext(nil) |
| @@ -8,14 +8,14 @@ import ( | @@ -8,14 +8,14 @@ import ( | ||
| 8 | ) | 8 | ) |
| 9 | 9 | ||
| 10 | type UserAuth struct { | 10 | type UserAuth struct { |
| 11 | - jwt.StandardClaims | ||
| 12 | - UserId int64 `json:"userId"` | ||
| 13 | - CompanyId int64 `json:"companyId"` | ||
| 14 | - CompanyName string `json:"companyName"` | ||
| 15 | - Phone string `json:"phone"` | ||
| 16 | - PlatformId int `json:"platformId"` | ||
| 17 | - Name string `json:"name"` | ||
| 18 | - AdminType int `json:"adminType"` | 11 | + jwt.StandardClaims `json:"-"` |
| 12 | + UserId int64 `json:"userId"` | ||
| 13 | + CompanyId int64 `json:"companyId"` | ||
| 14 | + CompanyName string `json:"companyName"` | ||
| 15 | + Phone string `json:"phone"` | ||
| 16 | + PlatformId int `json:"platformId"` | ||
| 17 | + Name string `json:"name"` | ||
| 18 | + AdminType int `json:"adminType"` | ||
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | var issuer = "performance" | 21 | var issuer = "performance" |
| @@ -21,7 +21,7 @@ func TestGenerateToken(t *testing.T) { | @@ -21,7 +21,7 @@ func TestGenerateToken(t *testing.T) { | ||
| 21 | 21 | ||
| 22 | func TestParsetToken1(t *testing.T) { | 22 | func TestParsetToken1(t *testing.T) { |
| 23 | ut := UserAuth{} | 23 | ut := UserAuth{} |
| 24 | - str := `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM2MjQ3MTYsImlzcyI6InBlcmZvcm1hbmNlIiwidXNlcklkIjozNDIyMTg1MzQwMTIyNjI0LCJjb21wYW55SWQiOjgsImNvbXBhbnlOYW1lIjoiIiwicGhvbmUiOiIxMzA2NjY2NzcxMCIsInBsYXRmb3JtSWQiOjI5LCJuYW1lIjoiIiwiYWRtaW5UeXBlIjoxfQ.JLvIwDeY6mArmQE7NGs0u01NFArhedA6MphU94z_R04` | 24 | + str := `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM2OTY4NjIsImlzcyI6InBlcmZvcm1hbmNlIiwidXNlcklkIjozNDIyMTg1MzQwMTIyNjI0LCJjb21wYW55SWQiOjgsImNvbXBhbnlOYW1lIjoiIiwicGhvbmUiOiIxMzA2NjY2NzcxMCIsInBsYXRmb3JtSWQiOjI5LCJuYW1lIjoiIiwiYWRtaW5UeXBlIjoxfQ.M_0HuXFGfZWdVFivDMsnuEaVtzHA6TOYeR3XAjr4lWo` |
| 25 | tk, err := ut.ParseAccessToken(str) | 25 | tk, err := ut.ParseAccessToken(str) |
| 26 | t.Logf("err:%s", err) | 26 | t.Logf("err:%s", err) |
| 27 | t.Logf("%+v", tk) | 27 | t.Logf("%+v", tk) |
-
请 注册 或 登录 后发表评论