V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
lithium148
V2EX  ›  问与答

云函数在服务器执行和在本地执行效果不一致?

  •  
  •   lithium148 · 2020-09-07 15:47:48 +08:00 · 582 次点击
    这是一个创建于 1332 天前的主题,其中的信息可能已经有所发展或是发生改变。

    微信小程序

     exports.main = async (event, context) => {
       db.collection('isRunning').get({
     success:res=>{
       console.log("结果为::::::::"+res.data[0].taskId)
       return res.data[0].taskId
     }
     })
    
    放在本地执行能读取到结果,在云函数执行返回 null,且 console.log("结果为:::)也没有输出。
    
    
    谢谢!
    
    2 条回复    2020-09-08 10:54:18 +08:00
    whileFalse
        1
    whileFalse  
       2020-09-07 17:38:01 +08:00
    确定云函数能直接用 async ?
    lithium148
        2
    lithium148  
    OP
       2020-09-08 10:54:18 +08:00
    @whileFalse 确定,async 是编译器自己生成的,不是我写的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1999 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 01:28 · PVG 09:28 · LAX 18:28 · JFK 21:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.