cool-team-official / cool-admin-midway

🔥 cool-admin(midway版)一个很酷的后台权限管理框架,模块化、插件化、CRUD极速开发,永久开源免费,基于midway.js 3.x、typescript、typeorm、mysql、jwt、vue3、vite、element-ui等构建

Home Page:https://cool-js.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rpc info有问题

sdttt1 opened this issue · comments

微服务

@CoolRpcService({
entity: DemoGoodsEntity,
method: ['add', 'delete', 'update', 'info', 'list', 'page'],
})
中使用
let result = await this.rpc.call('goods', 'DemoGoodsService', 'info', {
id: 1
});
报错误
{
"code": 1001,
"message": "You must provide selection conditions in order to find a single row."
}

请修改一下
@cool-midway/rpc/base.js 中的async info() 中的 const info = await this.entity.findOne({ id });为 const info = await this.entity.createQueryBuilder().where({id}).getOne();