Explorar o código

command命令

Roc hai 3 meses
pai
achega
cbad3e9678
Modificáronse 2 ficheiros con 1 adicións e 7 borrados
  1. 1 1
      utils/common.go
  2. 0 6
      utils/constants.go

+ 1 - 1
utils/common.go

@@ -598,7 +598,7 @@ func Sha1(data string) string {
 }
 
 func GetVideoPlaySeconds(videoPath string) (playSeconds float64, err error) {
-	cmd := `ffmpeg -i ` + videoPath + `  2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//`
+	cmd := fmt.Sprintf(`ffmpeg -i %s  2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//`, videoPath)
 	out, err := exec.Command("bash", "-c", cmd).Output()
 	if err != nil {
 		return

+ 0 - 6
utils/constants.go

@@ -37,12 +37,6 @@ const (
 	RegularEmail  = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*`                                             //匹配电子邮箱
 )
 
-// 验证码code
-const (
-	REGISTER_CODE = iota + 1 //注册
-	LOGIN_CODE               //登录
-)
-
 // 管理员,ficc管理员,ficc销售,权益管理员,权益销售。
 // 角色类型/类型编码
 const (