Browse Source

时间限制

xyxie 1 year ago
parent
commit
f53b205412
2 changed files with 9 additions and 0 deletions
  1. 4 0
      controllers/english_report/report.go
  2. 5 0
      controllers/report.go

+ 4 - 0
controllers/english_report/report.go

@@ -819,6 +819,10 @@ func (this *EnglishReportController) PrePublishReport() {
 		br.Msg = "发布时间不允许选择过去时间"
 		return
 	}
+	if prePublishTime.Before(time.Now().Add(2 * time.Minute)) {
+		br.Msg = "发布时间距离当前时间太近了"
+		return
+	}
 	report, err := models.GetEnglishReportById(reportId)
 	if err != nil {
 		br.Msg = "获取报告信息失败"

+ 5 - 0
controllers/report.go

@@ -2436,6 +2436,7 @@ func (this *ReportController) PrePublishReport() {
 		br.Msg = "发布时间不能为空"
 		return
 	}
+
 	if req.PreMsgSend != 0 && req.PreMsgSend != 1 {
 		br.Msg = "参数错误"
 		br.ErrMsg = "是否发送模版消息标识错误"
@@ -2451,6 +2452,10 @@ func (this *ReportController) PrePublishReport() {
 		br.Msg = "发布时间不允许选择过去时间"
 		return
 	}
+	if prePublishTime.Before(time.Now().Add(2 * time.Minute)) {
+		br.Msg = "发布时间距离当前时间太近了"
+		return
+	}
 	report, err := models.GetReportById(reportId)
 	if err != nil {
 		br.Msg = "获取报告信息失败"