jiaojiao7 4 жил өмнө
parent
commit
b9521bca55
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      utils/api_util.go

+ 1 - 1
utils/api_util.go

@@ -43,8 +43,8 @@ func Check(appID string, productID int, c *gin.Context, getData func() ([]map[st
 		return
 	}
 	//校验是否过期
+	now := time.Now().Unix()
 	if userProduct.CostModel != 1 {
-		now := time.Now().Unix()
 		end := userProduct.EndAt
 		if now > end.Unix() {
 			response.FailWithDetailed(response.InterfaceExpired, nil, "剩余量已过期", c)