Current location - Recipe Complete Network - Catering franchise - Solve the problem that the front-end page cannot be redirected by the back-end because the front-end page is developed independently.
Solve the problem that the front-end page cannot be redirected by the back-end because the front-end page is developed independently.
The company's project adopts the development mode of springboot+angularjs, and the front and rear ends are not completely separated. Some time ago, the project was changed to springboot+vue, and the front and rear ends were completely separated. There is a problem of back-end redirection in the development process. Back-end project address: http://localhost:8080/, front-end project address: http://localhost:9090/. For example, back-end redirection: "/#/main" redirects to this page, but the browser redirects to the address of the back-end project of http://localhost:8080/#/main. After searching for a long time, I finally found it.

We can handle it in devServer.proxy.onProxyRes, and the configuration is as follows: