code-push-server
code-push-server copied to clipboard
account-manager.js 第180行代码,将验证码临时存入redis,没有开启redis的服务端无法使用注册功能
proto.sendRegisterCode = function (email) {
if (_.isEmpty(email)) {
return Promise.reject(new AppError.AppError("请您输入邮箱地址"));
}
return models.Users.findOne({where: {email: email}})
.then((u) => {
if (u) {
throw new AppError.AppError(`"${email}" 已经注册过,请更换邮箱注册`);
}
})
.then(() => {
//将token临时存储到redis
var token = security.randToken(40);
var client = factory.getRedisClient("default");
return client.setexAsync(`${REGISTER_CODE}${security.md5(email)}`, EXPIRED, token)
.then(() => {
return token;
})
.finally(() => client.quit());
})
.then((token) => {
//将token发送到用户邮箱
var emailManager = new EmailManager();
return emailManager.sendRegisterCode(email, token);
})
};
将验证码临时存入redis,没有开启redis的服务端无法使用注册功能
哎,算了,我直接绕过它这个邮箱验证,前端验证一下邮箱格式算了,头疼,不知道咋搞这个东西