finish: gorm序列化

This commit is contained in:
eson
2023-06-14 18:17:45 +08:00
parent 50bca808f1
commit 6a2cfb14e9
26 changed files with 841 additions and 143 deletions

View File

@@ -24,8 +24,8 @@ func NewServiceContext(c config.Config) *ServiceContext {
func (svcCxt *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
AuthKey := r.Header.Get("Authorization")
if len(AuthKey) <= 50 {
return nil, errors.New(fmt.Sprint("Error parsing token, len:", len(AuthKey)))
if AuthKey == "" {
return nil, nil
}
token, err := jwt.Parse(AuthKey, func(token *jwt.Token) (interface{}, error) {