diff --git a/src/route.ts b/src/route.ts index a842386..d969f67 100644 --- a/src/route.ts +++ b/src/route.ts @@ -40,12 +40,12 @@ export const addAuth = (app: App) => { }) .define(async (ctx) => { const token = ctx.query.token; - if (checkAppId(ctx, app.appId)) { - ctx.state.tokenUser = { - username: 'default', - } - return; - } + // if (checkAppId(ctx, app.appId)) { + // ctx.state.tokenUser = { + // username: 'default', + // } + // return; + // } // 已经有用户信息则直接返回,不需要重复验证 if (ctx.state.tokenUser) { return; @@ -75,12 +75,12 @@ export const addAuth = (app: App) => { description: '验证token,可以不成功,错误不返回401,正确赋值到ctx.state.tokenUser,失败赋值null', }) .define(async (ctx) => { - if (checkAppId(ctx, app.appId)) { - ctx.state.tokenUser = { - username: 'default', - } - return; - } + // if (checkAppId(ctx, app.appId)) { + // ctx.state.tokenUser = { + // username: 'default', + // } + // return; + // } // 已经有用户信息则直接返回,不需要重复验证 if (ctx.state.tokenUser) { return; @@ -113,12 +113,12 @@ app description: '验证token,必须是admin用户, 错误返回403,正确赋值到ctx.state.tokenAdmin', }) .define(async (ctx) => { - if (checkAppId(ctx, app.appId)) { - ctx.state.tokenUser = { - username: 'default', - } - return; - } + // if (checkAppId(ctx, app.appId)) { + // ctx.state.tokenUser = { + // username: 'default', + // } + // return; + // } const tokenUser = ctx.state.tokenUser; if (!tokenUser) { ctx.throw(401, 'No User For authorized');