diff --git a/src/modules/user/service/sms.ts b/src/modules/user/service/sms.ts index ca774bf..47a22cf 100644 --- a/src/modules/user/service/sms.ts +++ b/src/modules/user/service/sms.ts @@ -74,7 +74,7 @@ export class UserSmsService extends BaseService { */ async checkCode(phone, code) { const cacheCode = await this.midwayCache.get(`sms:${phone}`); - if (cacheCode == code) { + if (code && cacheCode == code) { return true; } return false;