ifx: fix run ERROR

This commit is contained in:
2025-12-09 14:08:42 +08:00
parent c692061b23
commit a997dad00b
4 changed files with 2446 additions and 7 deletions

2439
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@kevisual/router",
"version": "0.0.36",
"version": "0.0.37",
"description": "",
"type": "module",
"main": "./dist/router.js",
@@ -28,7 +28,7 @@
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-typescript": "^12.3.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^24.10.1",
"@types/node": "^24.10.2",
"@types/send": "^1.2.1",
"@types/ws": "^8.18.1",
"@types/xml2js": "^0.4.14",

View File

@@ -107,8 +107,8 @@ export class App<U = {}> {
async queryRoute(path: string, key?: string, payload?: any, ctx?: AppRouteContext<U> & { [key: string]: any }) {
return await this.router.queryRoute({ path, key, payload }, ctx);
}
async run(path: string, key?: string, payload?: any, ctx?: AppRouteContext<U> & { [key: string]: any }) {
return await this.router.run({ path, key, payload }, ctx);
async run(msg: { id?: string, path?: string; key?: string; payload?: any }, ctx?: AppRouteContext<U> & { [key: string]: any }) {
return await this.router.run(msg, ctx);
}
exportRoutes() {
return this.router.exportRoutes();

View File

@@ -655,13 +655,13 @@ export class QueryRouterServer extends QueryRouter {
* @param param0
* @returns
*/
async run({ path, key, payload }: { path: string; key?: string; payload?: any }, ctx?: RouteContext & { [key: string]: any }) {
async run(msg: { id?: string; path?: string; key?: string; payload?: any }, ctx?: RouteContext & { [key: string]: any }) {
const handle = this.handle;
if (handle) {
const result = await this.call({ path, key, payload }, ctx);
const result = await this.call(msg, ctx);
return handle(result);
}
return super.run({ path, key, payload }, ctx);
return super.run(msg, ctx);
}
}