优化返回字段

This commit is contained in:
COOL 2024-07-22 16:25:09 +08:00
parent 2160dbe4e3
commit 16d8560734

View File

@ -1,12 +1,12 @@
import { Inject, Provide } from '@midwayjs/decorator';
import { BaseService, CoolCommException } from '@cool-midway/core';
import { Inject, Provide } from '@midwayjs/decorator';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Equal, Repository } from 'typeorm';
import { UserInfoEntity } from '../entity/info';
import { v1 as uuid } from 'uuid';
import { UserSmsService } from './sms';
import * as md5 from 'md5';
import { Equal, Repository } from 'typeorm';
import { v1 as uuid } from 'uuid';
import { PluginService } from '../../plugin/service/info';
import { UserInfoEntity } from '../entity/info';
import { UserSmsService } from './sms';
import { UserWxService } from './wx';
/**
@ -45,7 +45,9 @@ export class UserInfoService extends BaseService {
* @returns
*/
async person(id) {
return await this.userInfoEntity.findOneBy({ id: Equal(id) });
const info = await this.userInfoEntity.findOneBy({ id: Equal(id) });
delete info.password;
return info;
}
/**