Browse Source

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

hkshu12 5 years ago
parent
commit
798f7dfda4
1 changed files with 5 additions and 1 deletions
  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();