Vue cross-domain local node server

this is my vue cross-domain configuration

proxyTable: {
      "/api":{
        target:"https://api.douban.com",
        changeOrigin:true,
        pathRewrite:{
          "^/api":""
        },
        "/node":{
          target:"http://127.0.0.1:3000",
          changeOrigin:true,
          pathRewrite:{
            "^/node":""
          }
        }
      }

in the above configuration, the first cross-domain request Douban music works well, and the second cross-domain local node server is not. This server is an api of NetEase cloud music written by a great god on the Internet
my axios request

getMusician: function({commit}){
        axios.get("/node/personalized/newson")
        .then(function(response){
                console.log(response);
                commit("addMusician", response.result.slice(0,4));
            })
        .catch(function(err){
                console.log(err)
            })
    }

Cross-domain configuration of node server

app.all("*", function(req, res, next) {
  if (req.path !== "/" && !req.path.includes(".")) {
    res.header("Access-Control-Allow-Credentials", true)
    //  origin   *
    res.header("Access-Control-Allow-Origin", req.headers["origin"] || "*")
    res.header("Access-Control-Allow-Headers", "X-Requested-With")
    res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS")
    res.header("Content-Type", "application/json;charset=utf-8")
  }
  next()
})

when I make a cross-domain request, the browser reports an error
clipboard.png
which god can help

Aug.30,2021

because the error returned is 404. It should be that the path run by your local node server is not the same as the path you requested. Please check it carefully.


is it a cross-domain solution? Is header head OK? Or you can try cors, which is a third-party package, and the middleware completes cross-domain

.
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-1e920f7-460ed.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-1e920f7-460ed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?