diff --git a/dsRag/Start.py b/dsRag/Start.py index 37557279..f61e17d5 100644 --- a/dsRag/Start.py +++ b/dsRag/Start.py @@ -187,8 +187,8 @@ async def get_tree_data(): "title": row[1], "parent_id": row[2] if row[2] is not None else 0, "isParent": not row[3], - "prerequisite": row[4], - "related": row[5], + "prerequisite": json.loads(row[4]) if row[4] and len(json.loads(row[4])) > 0 else None, + "related": json.loads(row[5]) if row[5] and len(json.loads(row[5])) > 0 else None, "open": True } diff --git a/dsRag/static/tree.html b/dsRag/static/tree.html index 06d523c6..320a2e54 100644 --- a/dsRag/static/tree.html +++ b/dsRag/static/tree.html @@ -101,8 +101,8 @@ html += ''; } html += node.title + ''; - html += '' + (node.prerequisite || '无') + ''; - html += '' + (node.related || '无') + ''; + html += '' + (node.prerequisite || '') + ''; + html += '' + (node.related || '') + ''; html += ''; if (node.open && node.children && node.children.length > 0) {