报错修复
- 1,编译时报错:当前项目中存在与(opendb-app-list.schema.json)同名的同类资源,请解决名字冲突(重命名或删除)后再试
在下面的目录中
uniCloud/database/
删除项目中自带的opendb-app-list.schema.json
(不带快捷键箭头图标的那个)即可
- 2,某些页面报错:
cannot read properties of undefined (reading uniIdToken)
在下面的文件中
/uniCloud/cloudfunctions/pk-app-common/index.obj.js
/uniCloud/cloudfunctions/pk-app-coupon/index.obj.js
/uniCloud/cloudfunctions/pk-app-distribution/index.obj.js
/uniCloud/cloudfunctions/pk-app-goods/index.obj.js
/uniCloud/cloudfunctions/pk-app-integral/index.obj.js
/uniCloud/cloudfunctions/pk-app-order/index.obj.js
/uniCloud/cloudfunctions/pk-app-util/index.obj.js
增加如下代码:
module.exports = {
_before: async function () {
this._event = { uniIdToken: this.getUniIdToken() }
this._context = { PLATFORM: this.getClientInfo().platform }
},
/// 其它代码... ///
}
- 3,微信小程序微信支付时报错:
appId required
在下边的文件中
/uniCloud/cloudfunctions/common/uni-config-center/uni-pay/config.json:3
"appid": "xxx",
修改为"appId": "xxx",
- 4,程序运行时,控制台报错:渲染时找不到 /static/default.jpg
在下边的目录中
/static/
增加文件 default.jpg
1 个回复
1***@qq.com
谢谢大佬分享