Explorar o código

台账修订,权限检查跳转调整

MaiXinRong hai 2 semanas
pai
achega
43eb4622e7
Modificáronse 1 ficheiros con 4 adicións e 16 borrados
  1. 4 16
      app/middleware/revise_check.js

+ 4 - 16
app/middleware/revise_check.js

@@ -44,28 +44,16 @@ module.exports = options => {
             yield next;
         } catch (err) {
             // 输出错误到日志
-            if (err.stack) {
-                this.logger.error(err);
-            } else {
-                this.getLogger('fail').info(JSON.stringify({
-                    error: err,
-                    project: this.session.sessionProject,
-                    user: this.session.sessionUser,
-                    body: this.session.body,
-                }));
-            }
+            this.log(err);
             // 重定向值标段管理
             if (this.helper.isAjax(this.request)) {
-                if (err.stack) {
-                    this.body = {err: 4, msg: '标段数据未知错误', data: null};
-                } else {
-                    this.body = {err: 3, msg: err.toString(), data: null};
-                }
+                this.ajaxErrorBody(err, '标段数据未知错误');
             } else {
+                this.postError(err, '标段数据未知错误');
                 if (this.helper.isWap(this.request)) {
                     this.redirect('/wap/subproj');
                 } else {
-                    err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect(`/sp/${ctx.subProject.id}/list`);
+                    this.redirect(this.request.headers.referer);
                 }
             }
         }