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

fix: 在有basename的情况下__serverLoader的请求路径需要加上basename #11739

Merged
merged 28 commits into from
Oct 16, 2023
Merged

Conversation

gwuhaolin
Copy link
Member

No description provided.

奇风 and others added 28 commits October 8, 2023 12:00
@vercel
Copy link

vercel bot commented Oct 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 15, 2023 0:37am

@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (1babc1e) 28.94% compared to head (c47a03c) 28.94%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11739   +/-   ##
=======================================
  Coverage   28.94%   28.94%           
=======================================
  Files         485      485           
  Lines       14774    14774           
  Branches     3501     3502    +1     
=======================================
  Hits         4276     4276           
  Misses       9738     9738           
  Partials      760      760           
Files Coverage Δ
packages/renderer-react/src/browser.tsx 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -265,7 +265,8 @@ const getBrowser = (
// server loader
// use ?. since routes patched with patchClientRoutes is not exists in opts.routes
if (!isFirst && opts.routes[id]?.hasServerLoader) {
fetch('/__serverLoader?route=' + id)
// 在有basename的情况下__serverLoader的请求路径需要加上basename
fetch((basename.endsWith('/') ? basename : basename + '/') + '__serverLoader?route=' + id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch(`${withEndSlash(basename)}__serverLoader?route=${id}`)

function withEndSlash(s: string) {
  return s.endsWith('/') ? s : `${s}/`
}

@sorrycc sorrycc merged commit 9e15f1e into umijs:master Oct 16, 2023
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

Successfully merging this pull request may close these issues.

3 participants