|
@@ -88,9 +88,7 @@ class UserService extends CrudService {
|
|
|
// 发邮件
|
|
|
const data = { template: 'bindEmail', receiver: email, params: { code } };
|
|
|
const url = `${this.emailServiceUrl}/sendEmail`;
|
|
|
- const res = await this.httpUtil.cpost(url, data);
|
|
|
- console.log(res);
|
|
|
- return res;
|
|
|
+ await this.httpUtil.cpost(url, data);
|
|
|
}
|
|
|
async checkBindEmail({ code, id, email }) {
|
|
|
const redisData = await this.redis.get(`${this.emailKey}${id}`);
|
|
@@ -101,6 +99,7 @@ class UserService extends CrudService {
|
|
|
if (code !== rCode) throw new BusinessError(ErrorCode.DATA_INVALID, '验证码错误');
|
|
|
if (email !== rEmail) throw new BusinessError(ErrorCode.DATA_INVALID, '要绑定的邮箱与接收验证码的邮箱不是同一个邮箱');
|
|
|
await this.model.updateOne({ _id: id }, { email });
|
|
|
+ await this.redis.del(`${this.emailKey}${id}`);
|
|
|
}
|
|
|
}
|
|
|
|