add core/error/util files

This commit is contained in:
MaysWind
2020-10-17 17:22:10 +08:00
parent e5953c9f17
commit 6ad0a02d44
25 changed files with 917 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package core
import (
"github.com/dgrijalva/jwt-go"
)
type TokenType byte
const (
USER_TOKEN_TYPE_NORMAL TokenType = 1
USER_TOKEN_TYPE_REQUIRE_2FA TokenType = 2
)
type UserTokenClaims struct {
UserTokenId string `json:"userTokenId"`
Username string `json:"username,omitempty"`
Type TokenType `json:"type"`
jwt.StandardClaims
}