浏览代码

修复上传视频没有封面

kobe6258 7 月之前
父节点
当前提交
67d7130a89
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      controllers/video.go

+ 5 - 1
controllers/video.go

@@ -157,6 +157,10 @@ func (this *VideoController) AddVideo() {
 		br.Msg = "视频时长为空"
 		return
 	}
+	if req.CoverSrc == "" {
+		br.Msg = "封面为空"
+		return
+	}
 	var err error
 	//var coverSrc int
 	//permissions := strings.Split(req.PermissionIds, ",")
@@ -185,7 +189,7 @@ func (this *VideoController) AddVideo() {
 		AuthorName:            req.AnalystName,
 		MediaType:             models.Video,
 		Src:                   req.SrcUrl,
-		CoverSrc:              "",
+		CoverSrc:              req.CoverSrc,
 		MediaName:             req.VideoName,
 		SourceType:            "mp4",
 		MediaPlayMilliseconds: req.DurationMillisecond,