兄弟,问题解决了吗? 遇到同样的问题啊~~~
开发者工具incorrect header check[图片] 从昨天开始 就出现incorrect header 问题 确定不是代码的问题,求解答
2019-10-24我好像知道答案了,小程序端的db.command包含的命令比云端函数包含的多,具体多出以下几个: [代码]command.exists[代码][代码]command.mod[代码][代码]command.all[代码][代码]command.elemMatch[代码][代码]command.size[代码][代码]command.nor[代码][代码]command.not[代码]
db.command.all 方法为什么会找不到?[图片] [图片]
2019-09-25注释的这一段,运行OK。 现在运行的这一段,报错。 [图片] 两次运行的结果如下: [图片] 上面是第一次调用的,注释掉之后上传再调用,就是下面的这个错,为什么???
"_.all is not a function" 明明声明了db.command对象,怎么会这样?[代码]// 云函数入口文件[代码][代码]const cloud = require([代码][代码]'wx-server-sdk'[代码][代码])[代码] [代码]cloud.init({[代码][代码] [代码][代码]env: cloud.DYNAMIC_CURRENT_ENV[代码][代码]})[代码] [代码]const db = cloud.database()[代码] [代码]// 云函数入口函数[代码][代码]exports.main = async (event, context) => {[代码][代码] [代码][代码]const wxContext = cloud.getWXContext();[代码][代码] [代码][代码]return[代码] [代码]await onAggr_All(event);[代码][代码]}[代码] [代码]async [代码][代码]function[代码] [代码]onAggr_All(event) {[代码][代码] [代码][代码]const _ = db.command[代码] [代码] [代码][代码]return[代码] [代码]await db.collection([代码][代码]'garbege'[代码][代码]).where({[代码][代码] [代码][代码]gar_cls: _.all([[代码][代码]'1'[代码][代码], [代码][代码]'2'[代码][代码]])[代码][代码] [代码][代码]}).get()[代码][代码]}[代码]下面是调用的返回内容: [代码]Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 790098a8-de9c-11e9-b869-525400697544, cloud function service error code -504002, error message _.[代码][代码]all[代码] [代码]is [代码][代码]not[代码] [代码]a function; at cloud.callFunction api; [代码][代码] [代码][代码]at new u (WAService.js:1)[代码][代码] [代码][代码]at d (WAService.js:1)[代码][代码] [代码][代码]at f (WAService.js:1)[代码][代码] [代码][代码]at Function.success (WAService.js:1)[代码][代码] [代码][代码]at WAService.js:1[代码][代码] [代码][代码]at C (WAService.js:1)[代码][代码] [代码][代码]at i.<anonymous> (WAService.js:1)[代码][代码] [代码][代码]at i.emit (WAService.js:1)[代码][代码] [代码][代码]at Rs (WAService.js:1)[代码][代码] [代码][代码]at WAService.js:1[代码]调用日志是这样的: [代码]日志内容 Request ID: 790098a8-de9c-11e9-b869-525400697544[代码][代码]执行时间: 2.49ms内存使用: 35.58 MB[代码][代码]返回结果[代码][代码]{[代码][代码]"errorCode"[代码][代码]:1,[代码][代码]"errorMessage"[代码][代码]:[代码][代码]"user code exception caught"[代码][代码],[代码][代码]"stackTrace"[代码][代码]:[代码][代码]"_.all is not a function"[代码][代码]}[代码] [代码]日志[代码][代码]START RequestId: 790098a8-de9c-11e9-b869-525400697544[代码] [代码]Event RequestId: 790098a8-de9c-11e9-b869-525400697544[代码] [代码]TypeError: _.[代码][代码]all[代码] [代码]is [代码][代码]not[代码] [代码]a function[代码] [代码] [代码][代码]at onAggr_All (/var/user/index.js:65:16)[代码] [代码] [代码][代码]at EventHandler.exports.main [as realHandler] (/var/user/index.js:42:22)[代码] [代码] [代码][代码]at EventHandler.handle (/var/runtime/node8/bootstrap.js:324:28)[代码] [代码] [代码][代码]at invoke (/var/runtime/node8/bootstrap.js:128:22)[代码] [代码] [代码][代码]at Timeout.setTimeout [as _onTimeout] (/var/runtime/node8/bootstrap.js:63:9)[代码] [代码] [代码][代码]at ontimeout (timers.js:475:11)[代码] [代码] [代码][代码]at tryOnTimeout (timers.js:310:5)[代码] [代码] [代码][代码]at Timer.listOnTimeout (timers.js:270:5)[代码] [代码] [代码] [代码]END RequestId: 790098a8-de9c-11e9-b869-525400697544[代码] [代码]Report RequestId: 790098a8-de9c-11e9-b869-525400697544 Duration:2ms Memory:256MB MaxMemoryUsed:35.578125MB[代码]
2019-09-241:在小程序端获取用户提交的FormID,传到后台保存。 2:后台完成之后,根据FormID,发送模板消息到前台。 我了解的大致如此,请指教。
服务器端如何推送消息通知小程序我现在有个业务需求,需要后台操作完成后主动推送消息通知小程序,有实现的思路吗
2019-09-24