提交 e8f4a74c 编写于 作者: 雪洛's avatar 雪洛

fix: captcha required error

上级 b6d0137f
...@@ -52,6 +52,11 @@ module.exports = async function (params = {}) { ...@@ -52,6 +52,11 @@ module.exports = async function (params = {}) {
type: LOG_TYPE.RESET_PWD_BY_EMAIL type: LOG_TYPE.RESET_PWD_BY_EMAIL
}) })
if (needCaptcha) { if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, { await verifyCaptcha.call(this, {
captcha, captcha,
scene: CAPTCHA_SCENE.RESET_PWD_BY_EMAIL scene: CAPTCHA_SCENE.RESET_PWD_BY_EMAIL
......
...@@ -52,6 +52,11 @@ module.exports = async function (params = {}) { ...@@ -52,6 +52,11 @@ module.exports = async function (params = {}) {
type: LOG_TYPE.RESET_PWD_BY_SMS type: LOG_TYPE.RESET_PWD_BY_SMS
}) })
if (needCaptcha) { if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, { await verifyCaptcha.call(this, {
captcha, captcha,
scene: CAPTCHA_SCENE.RESET_PWD_BY_SMS scene: CAPTCHA_SCENE.RESET_PWD_BY_SMS
......
...@@ -14,6 +14,9 @@ const { ...@@ -14,6 +14,9 @@ const {
SMS_SCENE, SMS_SCENE,
LOG_TYPE LOG_TYPE
} = require('../../common/constants') } = require('../../common/constants')
const {
ERROR
} = require('../../common/error')
/** /**
* 短信验证码登录 * 短信验证码登录
...@@ -51,6 +54,11 @@ module.exports = async function (params = {}) { ...@@ -51,6 +54,11 @@ module.exports = async function (params = {}) {
}) })
if (needCaptcha) { if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, { await verifyCaptcha.call(this, {
captcha, captcha,
scene: CAPTCHA_SCENE.LOGIN_BY_SMS scene: CAPTCHA_SCENE.LOGIN_BY_SMS
......
...@@ -71,6 +71,11 @@ module.exports = async function (params = {}) { ...@@ -71,6 +71,11 @@ module.exports = async function (params = {}) {
email email
}) })
if (needCaptcha) { if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, { await verifyCaptcha.call(this, {
captcha, captcha,
scene: CAPTCHA_SCENE.LOGIN_BY_PWD scene: CAPTCHA_SCENE.LOGIN_BY_PWD
......
...@@ -14,6 +14,9 @@ const { ...@@ -14,6 +14,9 @@ const {
preBind, preBind,
postBind postBind
} = require('../../lib/utils/relate') } = require('../../lib/utils/relate')
const {
ERROR
} = require('../../common/error')
/** /**
* 通过短信验证码绑定手机号 * 通过短信验证码绑定手机号
...@@ -47,6 +50,11 @@ module.exports = async function (params = {}) { ...@@ -47,6 +50,11 @@ module.exports = async function (params = {}) {
type: LOG_TYPE.BIND_MOBILE type: LOG_TYPE.BIND_MOBILE
}) })
if (needCaptcha) { if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, { await verifyCaptcha.call(this, {
captcha, captcha,
scene: CAPTCHA_SCENE.BIND_MOBILE_BY_SMS scene: CAPTCHA_SCENE.BIND_MOBILE_BY_SMS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册