Explorar o código

download file by attach model

yinbangzhong %!s(int64=2) %!d(string=hai) anos
pai
achega
6ad7d3b807
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      controllers/audio.go

+ 2 - 1
controllers/audio.go

@@ -91,7 +91,8 @@ func (slf AudioCtl) Upload(c *gin.Context) {
 			}
 			//解析 交路号:123_公里标:321
 			fileds := string(bts)
-			arr = strings.Split(fileds, "_")
+			//按照换行或者回车分割
+			arr := strings.Split(fileds, "\n")
 			if len(arr) != 2 {
 				util.ResponseFormat(c, code.RequestParamError, "文件内容格式不对")
 				return