| 12345678910111213141516171819202122232425262728293031323334353637383940414243 | 
							- 'use strict';
 
- /**
 
-  *
 
-  *
 
-  * @author EllisRan
 
-  * @date
 
-  * @version
 
-  */
 
- const scPermission = require('../const/schedule').permission;
 
- module.exports = options => {
 
-     /**
 
-      * 投资进度校验 中间件
 
-      *
 
-      * @param {function} next - 中间件继续执行的方法
 
-      * @return {void}
 
-      */
 
-     return function* scheduleCheck(next) {
 
-         try {
 
-             if (this.tender.schedule_permission === scPermission.no) {
 
-                 throw '您无权查看该内容';
 
-             }
 
-             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,
 
-                 }));
 
-             }
 
-             if (this.helper.isWap(this.request)) {
 
-                 this.redirect('/wap/list');
 
-             } else {
 
-                 err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect('/list');
 
-             }
 
-         }
 
-     };
 
- };
 
 
  |