diff --git a/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts b/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts index cce5075fe..021cc94f4 100644 --- a/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts +++ b/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts @@ -27,7 +27,7 @@ export class PluginAPIKeysServer extends Plugin { async (ctx, next) => { const token = ctx.getBearerToken(); // TODO 固定长度判断来优化性能 - if (token && token.length !== 64) { + if (token?.length !== 64) { return await next(); } const key = await repo.findOne({