作者 tangxvhui

更新

... ... @@ -29,11 +29,11 @@ func dayEndTime(t time.Time) time.Time {
return t2
}
func dayZeroTime(t time.Time) time.Time {
y, m, d := t.Local().Date()
t2 := time.Date(y, m, d, 0, 0, 0, 0, time.Local)
return t2
}
// func dayZeroTime(t time.Time) time.Time {
// y, m, d := t.Local().Date()
// t2 := time.Date(y, m, d, 0, 0, 0, 0, time.Local)
// return t2
// }
func (srv TaskService) CreateTaskTest(param *command.CreateTaskCommand) error {
transactionContext, err := factory.CreateTransactionContext(nil)
... ...
... ... @@ -8,14 +8,14 @@ import (
)
type UserAuth struct {
jwt.StandardClaims
UserId int64 `json:"userId"`
CompanyId int64 `json:"companyId"`
CompanyName string `json:"companyName"`
Phone string `json:"phone"`
PlatformId int `json:"platformId"`
Name string `json:"name"`
AdminType int `json:"adminType"`
jwt.StandardClaims `json:"-"`
UserId int64 `json:"userId"`
CompanyId int64 `json:"companyId"`
CompanyName string `json:"companyName"`
Phone string `json:"phone"`
PlatformId int `json:"platformId"`
Name string `json:"name"`
AdminType int `json:"adminType"`
}
var issuer = "performance"
... ...
... ... @@ -21,7 +21,7 @@ func TestGenerateToken(t *testing.T) {
func TestParsetToken1(t *testing.T) {
ut := UserAuth{}
str := `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM2MjQ3MTYsImlzcyI6InBlcmZvcm1hbmNlIiwidXNlcklkIjozNDIyMTg1MzQwMTIyNjI0LCJjb21wYW55SWQiOjgsImNvbXBhbnlOYW1lIjoiIiwicGhvbmUiOiIxMzA2NjY2NzcxMCIsInBsYXRmb3JtSWQiOjI5LCJuYW1lIjoiIiwiYWRtaW5UeXBlIjoxfQ.JLvIwDeY6mArmQE7NGs0u01NFArhedA6MphU94z_R04`
str := `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM2OTY4NjIsImlzcyI6InBlcmZvcm1hbmNlIiwidXNlcklkIjozNDIyMTg1MzQwMTIyNjI0LCJjb21wYW55SWQiOjgsImNvbXBhbnlOYW1lIjoiIiwicGhvbmUiOiIxMzA2NjY2NzcxMCIsInBsYXRmb3JtSWQiOjI5LCJuYW1lIjoiIiwiYWRtaW5UeXBlIjoxfQ.M_0HuXFGfZWdVFivDMsnuEaVtzHA6TOYeR3XAjr4lWo`
tk, err := ut.ParseAccessToken(str)
t.Logf("err:%s", err)
t.Logf("%+v", tk)
... ...