mirror of
https://github.com/certd/certd.git
synced 2026-10-13 15:49:25 +08:00
chore(base-service): 修复findOneBy方法调用不兼容的问题
将弃用的findOneBy替换为标准的findOne查询方式,兼容新版本的TypeORM接口
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user