diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-email.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-email.js index 7b6ae911ef07baf4c9fdb1b6c694cc1cd490b4e1..c6aa9241d2a580fce167e7a723fbd22a6ee07702 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-email.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-email.js @@ -52,6 +52,11 @@ module.exports = async function (params = {}) { type: LOG_TYPE.RESET_PWD_BY_EMAIL }) if (needCaptcha) { + if (!captcha) { + throw { + errCode: ERROR.CAPTCHA_REQUIRED + } + } await verifyCaptcha.call(this, { captcha, scene: CAPTCHA_SCENE.RESET_PWD_BY_EMAIL diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-sms.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-sms.js index 05e68bf795c6907306534a796e78e66d80c2f22b..cda821aee33952fac1c72414bf426b1e19ac2ba5 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-sms.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-sms.js @@ -52,6 +52,11 @@ module.exports = async function (params = {}) { type: LOG_TYPE.RESET_PWD_BY_SMS }) if (needCaptcha) { + if (!captcha) { + throw { + errCode: ERROR.CAPTCHA_REQUIRED + } + } await verifyCaptcha.call(this, { captcha, scene: CAPTCHA_SCENE.RESET_PWD_BY_SMS diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-sms.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-sms.js index 8f9aeaf997d0be7026033bca8961aeb41062be4c..419c7cc70fda1e54a66b3a6b2bbdc680a08dee0a 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-sms.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-sms.js @@ -14,6 +14,9 @@ const { SMS_SCENE, LOG_TYPE } = require('../../common/constants') +const { + ERROR +} = require('../../common/error') /** * 短信验证码登录 @@ -51,6 +54,11 @@ module.exports = async function (params = {}) { }) if (needCaptcha) { + if (!captcha) { + throw { + errCode: ERROR.CAPTCHA_REQUIRED + } + } await verifyCaptcha.call(this, { captcha, scene: CAPTCHA_SCENE.LOGIN_BY_SMS diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login.js index 97e9cfea7ec33c546196fd03cf03464179954a50..396ec80a7c0f1b4c822b2dece486c1b700e9e1ac 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login.js @@ -71,6 +71,11 @@ module.exports = async function (params = {}) { email }) if (needCaptcha) { + if (!captcha) { + throw { + errCode: ERROR.CAPTCHA_REQUIRED + } + } await verifyCaptcha.call(this, { captcha, scene: CAPTCHA_SCENE.LOGIN_BY_PWD diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-sms.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-sms.js index 2275b054161365cb150f72bd672e09195da2d72e..12c2a67758ade8f960a449ec4f1a8942ffa86856 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-sms.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-sms.js @@ -14,6 +14,9 @@ const { preBind, postBind } = require('../../lib/utils/relate') +const { + ERROR +} = require('../../common/error') /** * 通过短信验证码绑定手机号 @@ -47,6 +50,11 @@ module.exports = async function (params = {}) { type: LOG_TYPE.BIND_MOBILE }) if (needCaptcha) { + if (!captcha) { + throw { + errCode: ERROR.CAPTCHA_REQUIRED + } + } await verifyCaptcha.call(this, { captcha, scene: CAPTCHA_SCENE.BIND_MOBILE_BY_SMS