chore: cleanup
This commit is contained in:
@@ -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('没有完成初始化!')
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user