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

创建uniCloud新项目并且是新服务空间,运行会报Error: Invalid uni-id config file错误

问题说明

新创建的服务空间,新起的项目,运行查询数据库就会报错,Uncaught (in promise) Error: Invalid uni-id config file,我记得在原来创建项目的时候,是不需要进行配置的,最近创建新项目出现了这个错误。
在这里插入图片描述

解决办法

1.找到目录uniCloud -> cloudfunctions -> common -> uni-config-center 下,创建uni-id目录,并创建config.json文件,如下结果所示:
在这里插入图片描述
2.在config.json中拷贝如下代码,不用做任何修改


{"passwordSecret": [{"type": "hmac-sha256","version": 1}], "passwordStrength": "medium", "tokenSecret": "0123456789", "requestAuthSecret": "9876543210", "tokenExpiresIn": 7200, "tokenExpiresThreshold": 3600, "maxTokenLength": 10, "passwordErrorLimit": 6, "passwordErrorRetryTime": 3600, "autoSetInviteCode": false, "forceInviteCode": false, "idCardCertifyLimit": 1, "realNameCertifyLimit": 5, "sensitiveInfoEncryptSecret": "", "frvNeedAlivePhoto": false, "userRegisterDefaultRole": [], "app": { "tokenExpiresIn": 2592000,"tokenExpiresThreshold": 864000,"oauth": {"weixin": {"appid": "","appsecret": ""},"qq": {"appid": "","appsecret": ""},"apple": { "bundleId": ""}}},"web": { "tokenExpiresIn": 7200,"tokenExpiresThreshold": 3600,"oauth": {"weixin-h5": { "appid": "","appsecret": ""},"weixin-web": { "appid": "","appsecret": ""}}},"mp-weixin": {"tokenExpiresIn": 259200,"tokenExpiresThreshold": 86400,"oauth": {"weixin": {"appid": "","appsecret": ""}}},"mp-qq": {"tokenExpiresIn": 259200,"tokenExpiresThreshold": 86400,"oauth": {"qq": {"appid": "","appsecret": ""}}},"mp-alipay": {"tokenExpiresIn": 259200,"tokenExpiresThreshold": 86400,"oauth": {"alipay": {"appid": "","privateKey": "", "keyType": "PKCS8" }}},"service": {"sms": {"name": "", "codeExpiresIn": 180, "scene": {"bind-mobile-by-sms": { "templateId": "", "codeExpiresIn": 240 }}},"univerify": {"appid": "" }}
}

上面这段config.json代码来自于uni-id的配置项,如果你懂得如何配置,自己根据下面提供的链接去拷贝即可,如果不懂uni-id,直接按照我的上面两个步骤就可以了。

uni-id的配置项:https://doc.dcloud.net.cn/uniCloud/uni-id/summary.html#config

上面即为出现Uncaught (in promise) Error: Invalid uni-id config file报错的解决方案了。


http://www.mrgr.cn/news/51932.html

相关文章:

  • 如何做好项目管理,实现高效协作?
  • Socket 网络编程与 C# 中的应用实例
  • 安装vue发生异常: idealTree:nodejs: sill idealTree buildDeps
  • FreeRTOS——中断管理
  • 15分钟学Go 第3天:编写第一个Go程序
  • 常见网络钓鱼类型
  • 多模块存储器相比单模块有哪些显著优势
  • 【学术前沿】PATHWAYS:谷歌大规模异构计算编排调度系统(Jeff Dean 和 Sanjay Ghemawat联合出品)
  • MacOS虚拟机安装Windows停滞在“让我们为你连接到网络”,如何解决?
  • IDEA中文乱码�
  • 轻松备考!这款 AI 工具助你高效复习 AP、IB 和 A-Leve
  • Nature子刊排名
  • iOS GCD的基本使用
  • FreeMarker模板引擎入门:从基础到实践的全面指南
  • CesiumJS 案例 P4:创建三角形、创建多边形、创建折线、创建盒子、创建圆柱
  • 【SAM模型应用于遥感影像|论文解读3】突破边界与一致性:SAM模型革新遥感影像语义分割
  • React状态管理工具zustand
  • Android开发跳去应用市场评分功能
  • 2025选题推荐|基于SpringBoot的幼儿园智能管理与监控系统的设计与实现
  • HarmonyOS 开发知识总结