V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xhf1024
V2EX  ›  React

react+antd 实现上传图片怎么调用接口传图片

  •  
  •   xhf1024 · Nov 19, 2019 · 3802 views
    This topic created in 2354 days ago, the information mentioned may be changed or developed.

    老哥们,大神们,怎么使用 react+antd 实现图片上传,后台接口的参数是 @RequestParam(value = "file") MultipartFile file 接口地址是 XXX/xxx/uploadImage 我前端不知道如何传参

    2 replies    2020-04-14 00:24:18 +08:00
    xhf1024
        1
    xhf1024  
    OP
       Nov 19, 2019
    求救求救,头皮挠破
    vent123
        2
    vent123  
       Apr 14, 2020 via iPhone
    用 xmlhttprequest, post 调用后台接口,content-type 是 multipartfile,requestpayload 是{file: imagefile} 具体怎么做你搜一下吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2438 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 01:11 · PVG 09:11 · LAX 18:11 · JFK 21:11
    ♥ Do have faith in what you're doing.