Browse Source

Merge branch 'feature/eta2.2.6_material' into debug

xyxie 6 days ago
parent
commit
9a387a0db1
2 changed files with 8 additions and 6 deletions
  1. 2 0
      controllers/material/material.go
  2. 6 6
      services/material/material.go

+ 2 - 0
controllers/material/material.go

@@ -828,6 +828,7 @@ func (this *MaterialController) SaveAsMaterial() {
 		br.ErrMsg = "参数解析失败,Err:" + err.Error()
 		return
 	}
+	req.MaterialName = strings.Trim(req.MaterialName, " ")
 	if req.MaterialName == "" {
 		br.Msg = "缺少素材库名称"
 		return
@@ -898,6 +899,7 @@ func (this *MaterialController) MyChartSaveAsMaterial() {
 			br.Msg = "请选择分类"
 			return
 		}
+		v.MaterialName = strings.Trim(v.MaterialName, " ")
 		if v.MaterialName == "" {
 			br.Msg = "请填写图片名称"
 			return

+ 6 - 6
services/material/material.go

@@ -197,9 +197,9 @@ func AddToMaterial(req material.SaveAsMaterialReq, opUserId int, opUserName stri
 	}
 	//素材主表信息
 	materialInfo := &material.Material{
-		MaterialName:    utils.TrimStr(req.MaterialName),
-		MaterialNameEn:  utils.TrimStr(req.MaterialName),
-		ImgUrl:          utils.TrimStr(resourceUrl),
+		MaterialName:    req.MaterialName,
+		MaterialNameEn:  req.MaterialName,
+		ImgUrl:          resourceUrl,
 		SysUserId:       opUserId,
 		SysUserRealName: opUserName,
 		ModifyTime:      time.Now(),
@@ -269,9 +269,9 @@ func MyChartAddToMaterial(req material.MyChartSaveAsMaterialReq, opUserId int, o
 
 		//素材主表信息
 		materialInfo := &material.Material{
-			MaterialName:    utils.TrimStr(v.MaterialName),
-			MaterialNameEn:  utils.TrimStr(v.MaterialName),
-			ImgUrl:          utils.TrimStr(resourceUrl),
+			MaterialName:    v.MaterialName,
+			MaterialNameEn:  v.MaterialName,
+			ImgUrl:          resourceUrl,
 			SysUserId:       opUserId,
 			SysUserRealName: opUserName,
 			ModifyTime:      time.Now(),