const { domain } = require('../config').server; const { isEmpty } = require('../utils/commons.util'); const { getConnection } = require('../services/connections.service'); const axios = require('axios'); module.exports = async (ctx, next) => { try { console.log('forward start ---------------'); // console.log(/^\/wai-server\/v\d{1}\/(?!channels|messages)/.test(ctx.path)); // const { waisession } = ctx.headers; // if (isEmpty(waisession)) { // await next(); // } else { // const findSession = await getConnection({ sesson_id: waisession, connect_domain: domain }); // if (!isEmpty(findSession)) { // // todo: 设置一个flag, 是否存在, 不用再查一遍 // } // } await next(); // todo: forward to target server console.log('forward End ---------------'); } catch (err) {} };