Procházet zdrojové kódy

fix: token model limit

CaIon před 2 roky
rodič
revize
521ef5e219
1 změnil soubory, kde provedl 10 přidání a 8 odebrání
  1. 10 8
      controller/token.go

+ 10 - 8
controller/token.go

@@ -124,14 +124,16 @@ func AddToken(c *gin.Context) {
 		return
 	}
 	cleanToken := model.Token{
-		UserId:         c.GetInt("id"),
-		Name:           token.Name,
-		Key:            common.GenerateKey(),
-		CreatedTime:    common.GetTimestamp(),
-		AccessedTime:   common.GetTimestamp(),
-		ExpiredTime:    token.ExpiredTime,
-		RemainQuota:    token.RemainQuota,
-		UnlimitedQuota: token.UnlimitedQuota,
+		UserId:             c.GetInt("id"),
+		Name:               token.Name,
+		Key:                common.GenerateKey(),
+		CreatedTime:        common.GetTimestamp(),
+		AccessedTime:       common.GetTimestamp(),
+		ExpiredTime:        token.ExpiredTime,
+		RemainQuota:        token.RemainQuota,
+		UnlimitedQuota:     token.UnlimitedQuota,
+		ModelLimitsEnabled: token.ModelLimitsEnabled,
+		ModelLimits:        token.ModelLimits,
 	}
 	err = cleanToken.Insert()
 	if err != nil {