chore: cleanup

This commit is contained in:
Innei
2022-06-11 12:44:45 +08:00
parent aaa4daf568
commit 71029fbefe
2 changed files with 1 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ export class UserService {
async getMasterInfo(getLoginIp = false) { async getMasterInfo(getLoginIp = false) {
const user = await this.userModel const user = await this.userModel
.findOne() .findOne()
.select(`-authCode${getLoginIp ? ' +lastLoginIp' : ''}`) .select(`${getLoginIp ? ' +lastLoginIp' : ''}`)
.lean({ virtuals: true }) .lean({ virtuals: true })
if (!user) { if (!user) {
throw new BadRequestException('没有完成初始化!') throw new BadRequestException('没有完成初始化!')

View File

@@ -14,7 +14,6 @@ describe('Test AuthService', () => {
id: '1', id: '1',
username: 'test-user', username: 'test-user',
email: 'tukon@gmail.com', email: 'tukon@gmail.com',
authCode: 'authCode',
} }
beforeAll(async () => { beforeAll(async () => {
const moduleRef = Test.createTestingModule({ const moduleRef = Test.createTestingModule({