Upload pictures on ElementUI+Express

in the development of the ElementUI+Express project, uploading pictures encountered this problem:

1ElementUI:
<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+ExpressSF

confirm that the interface is available. Does the interface allow cross-domain access?


this one of yours is developed separately from the front and rear ends. There are cross-domains. You cors, Baidu and then express it

.
var cors = require('cors') ;
app.use(cors())
ok
Access-Control-Allow-Origin:*

is your backend service running on port 80? if not, add a port

the error is that the options request has been rejected. Generally speaking, the reason why the port you requested is not running is that the corresponding service is not running.

if you upload, you can use the multiparty package of the front-end formData+Node to do this requirement

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c16141-47553.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c16141-47553.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?