|
@@ -61,7 +61,7 @@ export class LoginService {
|
|
}
|
|
}
|
|
|
|
|
|
async userLogin(data) {
|
|
async userLogin(data) {
|
|
- const user = await this.userModel.createQueryBuilder('t').where('t.username = :username', { account: data.username }).addSelect('t.password').getOne();
|
|
|
|
|
|
+ const user = await this.userModel.createQueryBuilder('t').where('t.username = :username', { username: data.username }).addSelect('t.password').getOne();
|
|
if (!user) throw new ServiceError(ErrorCode.USER_NOT_FOUND);
|
|
if (!user) throw new ServiceError(ErrorCode.USER_NOT_FOUND);
|
|
await this.checkAccountCanLogin(user, LoginType.Admin);
|
|
await this.checkAccountCanLogin(user, LoginType.Admin);
|
|
const result = bcrypt.compareSync(data.password, user.password);
|
|
const result = bcrypt.compareSync(data.password, user.password);
|