import {Context} from 'egg'; import ErrorCode from '../enums/ErrorCode'; export default (): (ctx: Context, next: () => Promise) => Promise => { return async (ctx: Context, next: () => Promise) => { ctx.app.throwErrorIf(!ctx.me, ErrorCode.E201003); await next(); }; };