当前位置: 首页 > news >正文

uniapp uni-id-co errCode“:“uni-id-captcha-required“,“errMsg“:“Captcha required

连续登录失败后就会出现图形验证码校验,如果前端不需要图形验证码校验,uni-id-co文件夹下找到module下的login文件夹下的login.js,注释掉Captcha相关校验,关掉即可

const {preLoginWithPassword,postLogin
} = require('../../lib/utils/login')
const {getNeedCaptcha,verifyCaptcha
} = require('../../lib/utils/captcha')
const {CAPTCHA_SCENE
} = require('../../common/constants')
const {ERROR
} = require('../../common/error')/*** 用户名密码登录* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login* @param {Object} params* @param {String} params.username  用户名* @param {String} params.mobile    手机号* @param {String} params.email     邮箱* @param {String} params.password  密码* @param {String} params.captcha   图形验证码* @returns*/
module.exports = async function (params = {}) {const schema = {username: {required: false,type: 'username'},mobile: {required: false,type: 'mobile'},email: {required: false,type: 'email'},password: 'password',captcha: {required: false,type: 'string'}}this.middleware.validate(params, schema)const {username,mobile,email,password,captcha} = paramsif (!username && !mobile && !email) {throw {errCode: ERROR.INVALID_USERNAME}} else if ((username && email) ||(username && mobile) ||(email && mobile)) {throw {errCode: ERROR.INVALID_PARAM}}// const needCaptcha = await getNeedCaptcha.call(this, {//   username,//   mobile,//   email// })// if (needCaptcha) {//   await verifyCaptcha.call(this, {//     captcha,//     scene: CAPTCHA_SCENE.LOGIN_BY_PWD//   })// }const {user,extraData} = await preLoginWithPassword.call(this, {user: {username,mobile,email},password})return postLogin.call(this, {user,extraData})
}

http://www.lqws.cn/news/140923.html

相关文章:

  • [华为eNSP] 在eNSP上实现IPv4地址以及IPv4静态路由的配置
  • kafka命令
  • Oj系统测试报告
  • Postgresql常规SQL语句操作
  • 软件工程:如何在项目中把软件做好
  • linux_centos7.x的ifconfig命令显示内容详解
  • 对抗性提示:大型语言模型的安全性测试
  • 【向量化模型如何私有化部署】一文说清原理、流程与最佳实践
  • 验证负载均衡与弹性伸缩
  • 猎板硬金镀层厚度:新能源汽车高压系统的可靠性基石
  • 【Windows开发】Windows 事件跟踪 (ETW)
  • QGIS新手教程3:QGIS矢量图层导入与导出+Shape Tools插件绘图
  • window 显示驱动开发-提供视频解码功能(二)
  • simulink这边重新第二次仿真时,直接UE5崩溃,然后simulink没有响应
  • 易基因:贵州省医刘代顺团队MeRIP-seq揭示m6A修饰在病毒感染中的免疫调控作用 | 项目文章
  • 深度剖析 DeepSeek 开源模型部署与应用:策略、权衡与未来走向
  • 数学复习笔记 26
  • matlab实现高斯烟羽模型算法
  • 灰狼优化算法MATLAB实现,包含种群初始化和29种基准函数测试
  • nt!CcInitializeCacheMap函数分析初始化Vacbs结构
  • 低空城市场景下的多无人机任务规划与动态协调!CoordField:无人机任务分配的智能协调场
  • 常用的Docker命令
  • 48V带极性反接保护-差共模浪涌防护方案
  • 2025-0604学习记录17——文献阅读与分享(2)
  • 安装 Nginx
  • 【Golang笔记04】Go语言中文件操作的学习笔记
  • Elasticsearch的插件(Plugin)系统介绍
  • Elasticsearch的审计日志(Audit Logging)介绍
  • 4. 数据类型
  • @Prometheus动态配置管理-ConsulConfd