Преглед изворни кода

fix: 添加错误捕获,可能还需要进一步处理

hkshu12 пре 5 година
родитељ
комит
798f7dfda4
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      src/views/Project/Schedule.vue

+ 5 - 1
src/views/Project/Schedule.vue

@@ -39,7 +39,11 @@ export default {
   },
   },
   methods: {
   methods: {
     async getTreeData() {
     async getTreeData() {
-      this.requirements = this.addChild2Node(await RequirementAPI.getTreeNodesByProjectId(this.$store.state.workspace.currentProjectId));
+      try {
+        this.requirements = this.addChild2Node(await RequirementAPI.getTreeNodesByProjectId(this.$store.state.workspace.currentProjectId));
+      } catch (e) {
+        console.error(e);
+      }
     },
     },
     addChild2Node(array) {
     addChild2Node(array) {
       const nodeMap = new Map();
       const nodeMap = new Map();