Skip to content

Commit

Permalink
Merge pull request #12 from adekang/main
Browse files Browse the repository at this point in the history
fix: env jwt
  • Loading branch information
hacxy authored Nov 5, 2024
2 parents 65e6eec + 91d308f commit 66f637a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/account/account.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { encryptPassword } from 'uni-nest';
import { JwtService } from '@nestjs/jwt';
import { ConfigService } from '@nestjs/config';
import { AccountLoginDto, CurrentUserDto } from './dto/account.dto';
import { JWT_SECRET_ENV_KEY, TOKEN_EXPIRES_ENV_KEY } from '../../constants';
import { PrismaService } from '../../common/prisma/prisma.service';
import { BusinessException } from '../../common/exceptions/business.exceptions';
@Injectable()
Expand All @@ -12,7 +11,7 @@ export class AccountService {
private readonly configService: ConfigService,
private readonly jwtService: JwtService,
private readonly prismaService: PrismaService
) {}
) { }

/**
* 登录
Expand All @@ -30,8 +29,8 @@ export class AccountService {
const token = this.jwtService.sign(
{ id, username },
{
secret: this.configService.get(JWT_SECRET_ENV_KEY),
expiresIn: this.configService.get(TOKEN_EXPIRES_ENV_KEY)
secret: this.configService.get('JWT_SECRET_ENV_KEY'),
expiresIn: this.configService.get('TOKEN_EXPIRES_ENV_KEY')
}
);
return { token };
Expand Down

0 comments on commit 66f637a

Please sign in to comment.