云函数调用subtract比较时间,可以是提示错误{"code":"SIGN_PARAM_INVALID","message":"authorization field not exsit"}
exports.main = async (event, context) => {
let currentTime = new Date()
console.log(currentTime)
let ret = await db.collection('DOCUMENTITEM').aggregate()
.project({
diff: $.subtract([currentTime, '$CreatedAt'])
})
.end()
return {
currentTime
}
}
具体错误如图所示?请各位大神指导。
let currentTime = $.dateFromString({ dateString: (new Date()).toLocaleString('zh-CN', { hour12: false }), timezone: 'Asia/Shanghai' })
若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人
"wx-server-sdk": "~2.0.3"