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

Microapp引入的链接只有域名的话,会重定向到 "主应用域名/baseroute" #1473

Open
Yulingsong opened this issue Dec 13, 2024 · 2 comments
Labels
Need Reproduction 需要复现步骤

Comments

@Yulingsong
Copy link

Yulingsong commented Dec 13, 2024

问题描述

问题的具体描述

复现步骤

  1. rc15版本里,microapp的url链接不同表现不同
  2. 假设基座域名a.com,子应用域名b.com,baseroute的为/xxxx
  3. 在主应用里点击需要跳转到子应用的某个页面 /pageC中。在主应用里的路径为 /xxxx/pageC,跳转方式是(router.push('/xxxx/pageC'))
  4. 如果mciroapp里url直接配置的是b.com,那么主应用里会先跳转到a.com/xxxx/pageC,然后重定向到a.com/xxxx
  5. 如果吧mciroapp里url改成b.com/xxxx/pageC就能正常
  6. 这个在本地无法复现。部署到服务器上才会偶现,所以demo没法提供

环境信息

  • micro-app版本:rc15
  • 主应用前端框架&版本:vue3
  • 子应用前端框架&版本:vue3
  • 构建工具&版本:vite
<micro-app
        :name="microAppName"
        :url="src"
        :baseroute="baseroute"
        :iframe="true"
        :keep-alive="true"
        router-mode="native-scope'"
        @created="created"
        @beforemount="beforemount"
        @mounted="mounted"
        @unmount="unmount"
        @error="error"
      />

@timhub66 timhub66 added the Need Reproduction 需要复现步骤 label Dec 25, 2024
Copy link

Hello @Yulingsong. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository.
您好 @Yulingsong, 为了方便定位和排查问题,我们需要您提供一个重现实例,请提供一个尽可能精简的 GitHub 仓库地址。

@Yulingsong
Copy link
Author

Yulingsong commented Dec 25, 2024

之前有个机器人给的回答可以用。配置url的时候就把baseroute带上。后面没复现了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need Reproduction 需要复现步骤
Projects
None yet
Development

No branches or pull requests

3 participants
@Yulingsong @timhub66 and others