Selaa lähdekoodia

返回错误信息统一调整

MaiXinRong 4 vuotta sitten
vanhempi
commit
d2ed7324a1

+ 2 - 2
app/base/base_controller.js

@@ -154,9 +154,9 @@ class BaseController extends Controller {
 
     ajaxErrorBody(error, msg) {
         if (error.stack) {
-            return {err: 2, msg: msg, data: null};
+            return {err: 4, msg: msg, data: null};
         } else {
-            return {err: 1, msg: error.toString(), data: null};
+            return {err: 3, msg: error.toString(), data: null};
         }
     }
 }

+ 1 - 1
app/controller/deal_bills_controller.js

@@ -116,7 +116,7 @@ module.exports = app => {
                 if (stream) {
                     await sendToWormhole(stream);
                 }
-                ctx.body = {err: 1, msg: err.toString(), data: null};
+                this.ajaxErrorBody(err, '导入数据失败');
             }
         }
 

+ 2 - 2
app/middleware/tender_check.js

@@ -94,9 +94,9 @@ module.exports = options => {
             }
             if (this.helper.isAjax(this.request)) {
                 if (err.stack) {
-                    this.body = {err: 2, msg: '标段数据未知错误', data: null};
+                    this.body = {err: 4, msg: '标段数据未知错误', data: null};
                 } else {
-                    this.body = {err: 1, msg: err.toString(), data: null};
+                    this.body = {err: 3, msg: err.toString(), data: null};
                 }
             } else {
                 if (this.helper.isWap(this.request)) {

+ 2 - 2
app/middleware/uncheck_tender_check.js

@@ -49,9 +49,9 @@ module.exports = options => {
             }
             if (this.helper.isAjax(this.request)) {
                 if (err.stack) {
-                    this.body = {err: 2, msg: '标段数据未知错误', data: null};
+                    this.body = {err: 4, msg: '标段数据未知错误', data: null};
                 } else {
-                    this.body = {err: 1, msg: err.toString(), data: null};
+                    this.body = {err: 3, msg: err.toString(), data: null};
                 }
             } else {
                 if (this.helper.isWap(this.request)) {

+ 1 - 1
app/service/revise_bills.js

@@ -46,7 +46,7 @@ module.exports = app => {
          */
         async addReviseNode(tid, rid, lid, count) {
             if (!rid) return null;
-            return await this.addNodeBatch(tid, lid, {crid: rid, revise_calc: 1}, count);
+            return await this.addNodeBatch(tid, lid, {crid: rid, check_calc: 1}, count);
         }
 
         /**