the asynchronous request code in a general vue project is as follows:
invoke asynchronous request:
axios.get("/api/index.json").then()
The configuration code in config/index.js is as follows:
proxyTable: {
"/api": {
target: "http://23.8.32.xxx",
pathRewrite: {
"^/api": "/static/mock"
}
}
},
npm run dev
the data is accessible in the browser.
but packaged as apk
, we can access the page through cordova serve android
, and then access the page through http://localhost:8000/android/www/index.html-sharp/
in the browser (just like seeing the page on a mobile phone). The corresponding asynchronous request becomes http://localhost:8000/android/www/api/index.json
, and this request returns 404
. So how do we modify the code that calls the asynchronous request above and the code related to the configuration of the asynchronous request
?