u
This commit is contained in:
1 parent
01ea998605
commit
d1b1aafc57
9 files changed
+82
-35
No files matched your search
@@ -3,6 +3,7 @@ package jwt
|
||||
import (
|
||||
commonConfig "base-framework/pkg/config"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/golang-jwt/jwt"
|
||||
@@ -23,6 +24,7 @@ type CustomClaims struct {
|
||||
// CreateToken 创建一个 JWT token
|
||||
func CreateToken(orgID, userID string) (string, error) {
|
||||
expireAt := time.Now().Add(commonConfig.JWT.Expiry)
|
||||
fmt.Println("Token 过期时间:", expireAt.Format(time.RFC3339))
|
||||
|
||||
claims := CustomClaims{
|
||||
OrgID: orgID,
|
||||
|
||||
Reference in new issue
Block a user