fix: add default key

This commit is contained in:
xion 2024-10-17 01:01:49 +08:00
parent f265fae3b9
commit 041432baea

View File

@ -461,7 +461,7 @@ export class QueryRouter {
if (!message?.path) {
return Promise.resolve({ code: 404, body: 'Not found path' });
}
const { path, key, payload = {}, ...query } = message;
const { path, key = '', payload = {}, ...query } = message;
ctx = ctx || {};
ctx.query = { ...ctx.query, ...query, ...payload };
ctx.state = {};