|
@@ -13,6 +13,7 @@ class UserService extends CrudService {
|
|
|
this.emailKey = 'bindEmail:';
|
|
|
this.httpUtil = this.ctx.service.util.httpUtil;
|
|
|
this.emailServiceUrl = _.get(this.app, 'config.httpPrefix.email');
|
|
|
+ this.emailServiceConfig = _.get(this.app, 'config.emailConfig.config');
|
|
|
this.conenctCode = '&&';
|
|
|
}
|
|
|
async beforeCreate(data) {
|
|
@@ -86,7 +87,7 @@ class UserService extends CrudService {
|
|
|
const value = `${email}${this.conenctCode}${code}`;
|
|
|
await this.redis.set(`${this.emailKey}${id}`, value, 'EX', 300);
|
|
|
// 发邮件
|
|
|
- const data = { template: 'bindEmail', receiver: email, params: { code } };
|
|
|
+ const data = { config: this.emailServiceConfig, template: 'bindEmail', receiver: email, params: { code } };
|
|
|
const url = `${this.emailServiceUrl}/sendEmail`;
|
|
|
await this.httpUtil.cpost(url, data);
|
|
|
}
|