在自定义的云函数中引用uni-id
按照官方文档在自定义云函数目录执行
npm init -y
npm install ../common/uni-id
在自定义函数中引入uni-id
运行失败 报错如下
[vlink_unicloud] 11:07:35.556 [本地运行:阿里云:vlink-unicloud]运行日志:
Error: 请在公用模块uni-id的config.json或init方法中添加undefined平台微信登录配置项
at Vr (/Users/suo/Documents/HBuilderProjects/vlink_unicloud/cloudfunctions-aliyun/common/uni-id/index.js:1:55527)
at loginByWeixin (/Users/suo/Documents/HBuilderProjects/vlink_unicloud/cloudfunctions-aliyun/common/uni-id/index.js:1:61061)
at Object.loginByWeixin (/Users/suo/Documents/HBuilderProjects/vlink_unicloud/cloudfunctions-aliyun/common/uni-id/index.js:1:3026)
at Object.exports.main (/Users/suo/Documents/HBuilderProjects/vlink_unicloud/cloudfunctions-aliyun/login-by-weixin/index.js:6:29)
at w (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/unicloud/aliyun/index.js:1:9320)
at j (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/unicloud/aliyun/index.js:1:9709)
at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/unicloud/aliyun/index.js:1:11096
at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/unicloud/aliyun/index.js:1:11101
at Object.<anonymous> (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/unicloud/aliyun/index.js:1:11224)
at Module._compile (module.js:649:14)
[vlink_unicloud] 11:07:36.594 [本地运行:阿里云:vlink-unicloud]运行状态:失败
4 个回复
1***@qq.com
官方就像瞎了一样,也不出来给个解决办法
MonikaCeng
你用【电脑自带的】文件浏览器看看/common/uni-id文件夹是不是空的
DCloud_uniCloud_WYQ
什么版本的uni-id? 看一下config.json内是不是带了注释
yangyangdie
在 插件市场 中 导入 UNI_MODULES UNI-ID 模块失败, 在HBUILDERX 中提示 "插件[UNI_MODULES] 处理外部应用 请求未能完成" 试了几次无效. 当前HBUILDERX 版本3.2.2