一般在新建项目的时候,会出现异常,一般的解决方法, 先上传一次db 表,然后 上传一次所有云函数 。
出现问题:Error: Invalid uni-id config file
解决方法:
配置小程序 隐私 和用户服务: 出现微信无法访问隐私链接,最后定位是:
必须公司认证的小程序,开通业务服务地址. 在里面配置上白名单.
完成sms code edit .
1. 短信
a . 去掉\uni-id-pages\uniCloud\cloudfunctions\uni-id-co\module\verify\send-sms-code.js 中的测试代码
b sms.js 修改部分模板id 的取值。
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/sms.js
const sceneConfig = (smsConfig.scene || {})[scene] || {}
if (!templateId) {
templateId = smsConfig.templateId
}
c 在配置中心增加
"service": {
"sms": {
"name": "应用名称,对应短信模版的name",
"codeExpiresIn": 300,
"smsKey": "111",
"smsSecret": "222",
"templateId":"12598"
},
"univerify": {
"appid": "当前应用的appid,使用云函数URL化,此项必须配置",
"apiKey": "333",
"apiSecret": "444"
}
}
}
1. 怀疑云函数运行失败的话,可能是node js 版本或node js 需要的依赖库忘记增加了
2. static 目录下无法增加过多的图片资源,否则小程序打包失败。
3.
weixin login :
需要在统一配置模板中填写 微信 appid 和密钥。
h5 发布:
1. 在配置文件中, 设置 路由模式hash,
2. 基础路径为./ --- 另外 页面直接发布为h5目录下。
3. 配置白名单 ,否则h5 访问不了。
4.
window.location.href ="http://aqqqcn:3000"