1 devserver: {2Host: ' 192.168.1.58 ',3port:9999,4Historyapifallback:true,5Noinfo:true,6Overlaytrue,7 //Configuring the service agent8 9 Proxy: {Ten'/hydro/': {//as long as the request to/hydro/, will automatically proxy to the address of the following target OneTarget: "http://192.168.1.180:8081",//Offset server address A //pathrewrite: { - //' ^/hydrowebapp ': '/' - // }, theSecurefalse, -Changeorigin:true - }, - } + -},
Cross-domain issues, Webpack configured proxy servers, but only valid in the development environment, NPM run build is packaged and then invalidated.
WebApp placed in the Nginx server, Nginx agent, you can solve the cross-domain problem
WebApp to transform the mobile app, using pure HTML, using Hbuilder for the real-machine test after packaging,
Initially tested with Google Chrome,
Page report Access-control-allow-origin cross-domain errors, so start a variety of cross-domain solutions,
Finally found that the app does not exist across domains one says!
Testing in the browser, $http to request cross-domain errors, but the app packaged on the real machine running, is not a problem ...
Bloody lesson ah, hard to toss for a long time, and then found that the real machine does not exist this problem, really ... There's nothing to say!
Record their own painful experience, a total of mutual encouragement! Thank you!
=================================================
Machine debugging, the browser can not cross the domain, the phone is normal cross-domain, the console to the phone can see the results of cross-domain normally
This error is reported in the "side by side view Console" display.
If it doesn't work, re-connect your phone and restart the dock app to try it out.
Bloody lesson-Package Vue projects into app cross-domain issues