Browse Source

时间限制

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

+ 4 - 0
controllers/english_report/report.go

@@ -611,6 +611,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 = "获取报告信息失败"

+ 4 - 0
controllers/report.go

@@ -3109,6 +3109,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 = "获取报告信息失败"