fix(copy): use glossary punctuation in route loading error
This commit is contained in:
1 parent
235bfcc654
commit
7042c053c0
1 file changed
+1
-1
@@ -10,7 +10,7 @@ const modules = import.meta.glob<PageModule>("./routes/**/*.tsx");
|
|||||||
|
|
||||||
async function loadPage(modulePath: string, href: string) {
|
async function loadPage(modulePath: string, href: string) {
|
||||||
const module = await modules[`./routes/${modulePath}.tsx`]?.();
|
const module = await modules[`./routes/${modulePath}.tsx`]?.();
|
||||||
if (!module) throw new Error(`路由模块不存在: ${modulePath}`);
|
if (!module) throw new Error(`路由模块不存在:${modulePath}`);
|
||||||
const result = await module.clientLoader?.({ request: new Request(new URL(href, window.location.origin)) });
|
const result = await module.clientLoader?.({ request: new Request(new URL(href, window.location.origin)) });
|
||||||
if (result instanceof Response && result.status >= 300 && result.status < 400) {
|
if (result instanceof Response && result.status >= 300 && result.status < 400) {
|
||||||
const target = new URL(result.headers.get("Location") ?? "/console", window.location.origin);
|
const target = new URL(result.headers.get("Location") ?? "/console", window.location.origin);
|
||||||
|
|||||||
Reference in new issue
Block a user