question
now the requirement is to package a piece of code, but for multiple projects, it is packaged and put directly locally, and tested with tomcat services. For example,
- http://localhost:39090/segment/fault/a/main/
- http://localhost:39090/segment/fault/b/main/
- http://localhost:39090/segment/fault/c/main/
means that relative path packaging needs to be carried out in history mode. At present, my practice is to obtain the base, of pathname dynamic change router, such as a
project to change base to"/ segment/fault/a/main",. At present, it is possible for me to pack the package once, and the four projects share a code, but the address is different. This method is not robust. if the gods have other ways to package once and share a code with multiple addresses, they would like to share .
the current problem is:
I can access http://localhost:39090/segment/fault/a/main/
directly in the address bar (redirected in the route), and route switching is not a problem, but I cannot access it by typing http://localhost:39090/segment/fault/a/main/TestManagement
or other specified routes in the address bar. I really don"t understand why. If you start the service locally npm run dev
, there is no problem with either of the two access methods.
router settings
http://localhost:39090/segment/fault/c/main/
can be accessed under these directories, and the corresponding route http://localhost:39090/segment/fault/a/main/TestManagement
can be accessed directly.
Thank you very much!