• 请不要在回答技术问题时复制粘贴 AI 生成的内容
phpxiaowangzi
V2EX  ›  程序员

小程序提交表单跟上传图片提交时发现图片数组为空

  •  
  •   phpxiaowangzi · Jul 31, 2019 · 2079 views
    This topic created in 2655 days ago, the information mentioned may be changed or developed.

    RT,小程序提交表单时想跟已缓存在本地的多张图片循环调用 uploadfile 方法返回的文件路径一起 post 到服务器,但是发现 uploadfile 是异步,还没获取到路径就已经 post 过去了,所以图片数组一直为空,求教有什么方法可以获取全图片路径后再 post 吗?求教大佬

    redbuck
    redbuck
    Jul 31, 2019
    1
    for/while+async/await
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4992 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 06:42 · PVG 14:42 · LAX 22:42 · JFK 01:42
    ♥ Do have faith in what you're doing.