After Vue uses HBuilder to package APP, it cannot access the data.

use vue to complete an app, and the backend does not use a proxy server like nginx, so after the HBuiderX is packaged into app, the request cannot be sent. The configuration of cofig/index.js under vue is as follows:

login.vue

, you can access the interface, but you have to add an address in front of it every time. In this way, the project volume will be large if the interface address is modified. Baidu app does not have the concept of cross-domain request. So do the bosses have any way to solve it?

May.11,2022

online environment proxyTable is invalid. Cross-domain or nginx configuration is recommended for the backend. If you don't want to write the host paragraph, you can package it in axios.

Menu