'use strict'; // 加密类 const crypto = require('crypto'); const messageType = require('../const/message_type'); module.exports = options => { /** * session判断中间件 * * @param {function} next - 中间件继续执行的方法 * @return {void} */ return function* wechatAuth(next) { try { // 判断session // const wechatToken = this.session.wechatToken; // if (wechatToken === undefined) { // throw '不存在session'; // } // // 同步系统维护信息 // yield this.service.maintain.syncMaintainData(); // if (this.session === null) { // throw '系统维护中~'; // } } catch (error) { console.log(error); this.body = error; return; } yield next; }; };