chore(base-service): 修复findOneBy方法调用不兼容的问题

将弃用的findOneBy替换为标准的findOne查询方式,兼容新版本的TypeORM接口
This commit is contained in:
xiaojunnuo
2026-09-03 21:37:52 +08:00
parent c8bdcdc778
commit 2ad14b82fa
@@ -75,7 +75,10 @@ export abstract class BaseService<T> {
if (!id) {
throw new ValidateException("id不能为空");
}
const info = await this.getRepository().findOneBy({ id } as any);
const info = await this.getRepository().findOne({
//@ts-ignore
where: { id },
});
if (info && infoIgnoreProperty) {
for (const property of infoIgnoreProperty) {
delete info[property];