After the vue project is packaged, it will not be deployed separately, and the vue-router will not be redirected.

I encounter a little problem at work. I don"t understand why. I hope all of you can give me some advice or give me a direction. thank you.

scenario: manage the console project, log in and jump to the home page

when deploying, the background (SpringBoot) places the program in the static folder, and the front-end webpack configuration changes the assetsPublicPath in the config/index.js file to". /"

in vue-router, hash mode is used, so it is no problem to jump after logging in in dev environment. There is still no problem with the jump when the front and rear ends are deployed separately. When the backend project and the frontend project are deployed under the same server, there is no problem logging in, and the backend returns to normal. Open f12 and see that the token field is also written in the front end of the application, but the jump is not performed. I don"t understand it very well here. Do you have to start it with a single service?

if the Great God has additional posts, please post them if it is convenient. Thank you

Jan.22,2022
Menu