Ununennium
V2EX  ›  问与答

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

  •  
  •   Ununennium · Sep 7, 2020 · 993 views
    This topic created in 2078 days ago, the information mentioned may be changed or developed.

    微信小程序

     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 replies    2020-09-08 10:54:18 +08:00
    whileFalse
        1
    whileFalse  
       Sep 7, 2020
    确定云函数能直接用 async ?
    Ununennium
        2
    Ununennium  
    OP
       Sep 8, 2020
    @whileFalse 确定,async 是编译器自己生成的,不是我写的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2986 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 07:54 · PVG 15:54 · LAX 00:54 · JFK 03:54
    ♥ Do have faith in what you're doing.