Before packaging:
1. Change the mode in the router to history, and change base to the name of the deployed front-end project.
2. Modify the tomcat configuration and add a line in web.xml
<error-page>
<error-code>404</error-code>
<location>/index.html</location>
</error-page>
3. Drop the project and start the server under tomcat.