Selaa lähdekoodia

1. 前端树结构,容错
2. 获取标段中间件Bug

MaiXinRong 6 vuotta sitten
vanhempi
commit
7ba19b9d8a
2 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 6 1
      app/middleware/tender_check.js
  2. 3 1
      app/public/js/path_tree.js

+ 6 - 1
app/middleware/tender_check.js

@@ -9,6 +9,7 @@
  */
 
 const auditConst = require('../const/audit').ledger;
+const messageType = require('../const/message_type');
 
 module.exports = options => {
     /**
@@ -53,7 +54,11 @@ module.exports = options => {
             if (err.stack) {
                 this.logger.error(err);
             } else {
-                this.setMessage(err, measureType.ERROR);
+                this.session.message = {
+                    type: messageType.ERROR,
+                    icon: 'exclamation-circle',
+                    message: err,
+                };
                 this.getLogger('fail').info(JSON.stringify({
                     error: err,
                     project: this.session.sessionProject,

+ 3 - 1
app/public/js/path_tree.js

@@ -295,7 +295,9 @@ const createNewPathTree = function (type, setting) {
                         this.children.push(item);
                     } else {
                         const parent = this.getParent(item);
-                        parent.children.push(item);
+                        if (parent) {
+                            parent.children.push(item);
+                        }
                     }
                 }
             }