Browse Source

Merge branch 'feature/knowledge' into dm

xyxie 6 months ago
parent
commit
ae7e5a0c50
1 changed files with 7 additions and 0 deletions
  1. 7 0
      services/knowledge/resource.go

+ 7 - 0
services/knowledge/resource.go

@@ -409,6 +409,13 @@ func ImportResourceData(path string, resourceType int, sysUser *system.Admin) (s
 	classifyNameMap := make(map[string]int)
 	for _, v := range classifyList {
 		name := fmt.Sprintf("%s/%s/%s", v.RootName, v.ParentName, v.ClassifyName)
+		if v.RootName == "" && v.ParentName == "" { //一级分类
+			name = fmt.Sprintf("%s/%s/%s", v.ClassifyName, "", "")
+		} else if v.RootName == "" { //二级分类
+			name = fmt.Sprintf("%s/%s/%s", v.ParentName, v.ClassifyName, "")
+		}
+
+		fmt.Println("name", name)
 		classifyNameMap[name] = v.ClassifyId
 	}