Commit 352b2c69 by 宋毅

tj

parent f13f9fa8
......@@ -435,7 +435,7 @@ class AccessAuthAPI extends APIBase {
return system.getResult(null, "验证码不能未空.");
}
var cacheKeyStr = appkey + "_" + pobj.mobile;
var cacheCode = await this.cacheManager["VCodeCache"].cache(cacheKeyStr, null);
var cacheCode = await this.cacheManager["VCodeCache"].getCache(cacheKeyStr);
if (!cacheCode || pobj.vcode != cacheCode.vcode) {
return system.getResultFail(system.verifyVCodeFail, "验证码校验不成功,请重新获取验证码验证.", system.verifyVCodeFail);
}
......
......@@ -19,15 +19,7 @@ class VCodeCache extends CacheBase {
async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
var pobj = val;
var vcode = await this.smsUtil.getUidStr(6, 10);
if (pobj.reqType) {
if (pobj.reqType == "otherVcode") {
//【XXX】您的验证码是:602639(5分钟内有效),工作人员不会索取,请勿泄露。-------描述在模板中配置
pobj.msgContent = vcode;
this.smsUtil.aliOtherSendMsg(pobj.mobile, pobj.accessKeyId, pobj.accessKeySecret, pobj.tmplCode,
pobj.signName, JSON.stringify({ code: vcode }));
}
}
else {
if (!pobj.reqType) {
//inputkey采用appkey_mobile的形式
var mobile = inputkey.split("_")[1];
var tmplCode = val;
......@@ -40,6 +32,14 @@ class VCodeCache extends CacheBase {
else {
this.smsUtil.aliSendMsg(mobile, tmplCode, signName, JSON.stringify({ code: vcode }));
}
return JSON.stringify({ vcode: vcode });
}
if (pobj.reqType == "otherVcode") {
//【XXX】您的验证码是:602639(5分钟内有效),工作人员不会索取,请勿泄露。-------描述在模板中配置
pobj.msgContent = vcode;
this.smsUtil.aliOtherSendMsg(pobj.mobile, pobj.accessKeyId, pobj.accessKeySecret, pobj.tmplCode,
pobj.signName, JSON.stringify({ code: vcode }));
}
return JSON.stringify({ vcode: vcode });
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment