this is my own service run with nodejs. You can visit
.
:
:
server.js
still report the same error ("^") ("^")
this is my own service run with nodejs. You can visit
.
:
:
server.js
still report the same error ("^") ("^")
your access to port 8081 services on port 8080 must be cross-domain. If you need to set some protocol headers, you can access
header ('Access-Control-Allow-Origin: *'); / / allow all sources to access
header ('Access-Control-Allow-Methods: POST'); / / response type
how to write the url you requested. It looks like your url directly wrote port 8081, or the agent did not take effect
summarize how to solve this problem:
1. If the url of the request is misspelled, you should write axios.get ('/ getRecommend); instead of axios.get ('127.0.0.1 getRecommend); 8081 GetRecommend');
2. The server.js on the server needs to set the protocol header
/ / Cross-domain setting
app.all ('*', function (req, res, next) {
res.send ("recommended data");
res.header ("Access-Control-Allow-Credentials", true)
res.header ("Access-Control-Allow-Origin", "*")
res.header ("Access-Control-Allow-Headers", "X-Requested-With")
res.header ("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS")
res.header ("X-Powered-By", '3.2.1')
res.header ("Content-Type", "application/json;") Charset=utf-8 ")
next ()
})
3. Add a timestamp
axios.get ('/ getRencomment+time='+new Date (). GetTime ());
...
recently a vue project developed with a proxy set in proxyTable . It is quite normal to use it in the early stage, but I don t know why there is an occasional connection timeout (the frequency is about 1max 20, which is estimated to be the efficiency ...
write an ajax request method, which is normal in the component, but it is not normal to extract it into the file of the public method, so report Cannot read property "$http " of undefined. What on earth is going on? I ve been studying it for a day, bu...
the following is demo <script> export default { props: [ userList , sessionIndex , session , search ], filters: { selection (list, sear) { return list.filter(item => item.name.indexOf(sear) > -1) } ...