jiaojiao7 4 年之前
父节点
当前提交
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
 		return
 	}
 	}
 	//校验是否过期
 	//校验是否过期
+	now := time.Now().Unix()
 	if userProduct.CostModel != 1 {
 	if userProduct.CostModel != 1 {
-		now := time.Now().Unix()
 		end := userProduct.EndAt
 		end := userProduct.EndAt
 		if now > end.Unix() {
 		if now > end.Unix() {
 			response.FailWithDetailed(response.InterfaceExpired, nil, "剩余量已过期", c)
 			response.FailWithDetailed(response.InterfaceExpired, nil, "剩余量已过期", c)