fix(router): 修复设置 basename 后不跳转默认路由的问题 #11427
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这个 PR 做了什么? (简要描述所做更改)
history升级到v5后取消了对
basename
的支持相关讨论1
相关讨论2
而对默认路由跳转的处理还是沿用的v4版本的方式,导致了使用如
https://.../basename
或https://.../basename/
这样的方式访问不会跳转到默认路由(browser 模式,使用Taro 3.4.3版本验证)。(用devServer和以下配置可以复现)config/dev.js
而老版本没有这个问题(使用Taro 3.2.7版本验证),这个问题应该是由这个PR引起的 @ZakaryCode ,所以应该从Taro 3.3.1版本开始就有这个问题了。这个问题会导致升级到新版本后只有
basename
的地址无法访问。这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: