收藏
回答

云函数 await 调用?

return  await cloud.uploadFile({

      cloudPath: dataCVS,

      fileContent: buffer, //excel二进制文件

    }).then(res=>{

      let filelist=[]

      filelist.push(res.fileID)

    //  return filelist

     await cloud.getTempFileURL({

          fileList: filelist,

        }).then(rec=>{

          return rec

        })

      })

不知怎么处理

Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 93f28b09-6067-11ea-8374-525400697544, cloud function service error code -504002, error message Unexpected identifier; at cloud.callFunction api;

    at new u (VM227 WAService.js:2)

    at d (VM227 WAService.js:2)

    at f (VM227 WAService.js:2)

    at Function.success (VM227 WAService.js:2)

    at VM227 WAService.js:2

    at x (VM227 WAService.js:2)

    at i.<anonymous> (VM227 WAService.js:2)

    at i.emit (VM227 WAService.js:2)

    at Ea (VM227 WAService.js:2)

    at VM227 WAService.js:2

回答关注问题邀请回答
收藏

2 个回答

  • hbzyliyong
    hbzyliyong
    2020-03-07

    我这种方法哪里错了?


    2020-03-07
    有用
    回复
  • Mr.Zhao
    Mr.Zhao
    2020-03-07
    let res = await cloud.uploadFile({
        cloudPath: dataCVS,
        fileContent: buffer
    })
    let filelist = []
    filelist.push(res.fileID)
    return await cloud.getTempFileURL({
        fileList: filelist,
    })
    
    2020-03-07
    有用
    回复
登录 后发表内容
问题标签