Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部署服务器二级目录,导致主应用访问不到子应用路由问题 #694

Open
875908494 opened this issue Aug 11, 2023 · 3 comments

Comments

@875908494
Copy link

875908494 commented Aug 11, 2023

问题描述:主应用和子应用部署到服务器二级目录,添加vite和router配置base为/wxb,主应用本地路由都能正常访问,但是访问子应用路由就无法加载到子应用。

1、部署后主应用可以正常访问其它路由
image

2、部署后访问子应用无法加载到对应子应用
image

3、本地因为base设置为"/" 所以子应用能够正常加载访问
image

4、本地base配置
image
image
image

5、还有部署二级目录后,主应用App.vue中的onRouteChange会无限执行,调用router.push,导致浏览器路由访问地址无限制拼接/wxb,注释了就不会了。
image
1691724166838

请问上面两个问题有什么办法解决吗,感谢各位大佬,目前比较急。

@ClarkXia
Copy link
Collaborator

主应用中的子应用配置发下,另外先确认子应用发布后的访问地址是什么

@875908494
Copy link
Author

主应用中的子应用配置发下,另外先确认子应用发布后的访问地址是什么

这是我主应用的配置,使用的动态路由菜单,所以是通过数据动态注册的。
image

子应用访问地址为:https://gmform.oss-cn-zhangjiakou.aliyuncs.com/wuxianbao/test/detailtools/001/index.html

@875908494
Copy link
Author

@ClarkXia 你好,请问有找到是什么原因吗,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants