账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    ElementUI+Express上传图片
    43
    0

    在ElementUI+Express项目开发中,上传图片碰到了这样的问题:

    1、首先,ElementUI代码如下:
    <el-upload action="http://localhost/goods/addNewGoodsPicture" :limit="1" :onError="uploadError" :onSuccess="uploadSuccess" list-type="picture">
        <el-button size="small" type="primary">点击上传</el-button>
    </el-upload>
    
    
    
    2、然后,我后台想尝试获取它传递的数据:
    router.post("/addNewGoodsPicture", function (req, res, next) {
      let newGoodsPicture = req.body.picture;
      console.log("newGoodsPicture"+newGoodsPicture);
      console.log("req:"+req);
    })
    
    
    3、结果,它给我报了个错误:
    OPTIONS http://localhost/goods/addNewGoodsPicture net::ERR_CONNECTION_REFUSED
    
    最后,想问下,有没有做过ElementUI+Express上传图片的同学,很想知道这要怎么去弄,因为我百度实在查不到相关资料了,所以想在SF提问一下有没有碰到相关问题的同学,谢谢!
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部