Skip to content

Commit dc8762d

Browse files
committed
Ensure consistent URL format without trailing slashes in example pages
- Add URL normalization logic to prevent automatic redirects to URLs with trailing slashes - Update handleExampleSelect function to generate URLs without trailing slash before query parameters - Implement path normalization to convert /example-detail/?id=... to /example-detail?id=... format - Add useEffect hook to monitor and correct URL format during navigation and language switching
1 parent 40808c2 commit dc8762d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/src/pages/examples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function getExampleLink(exampleId: string): string {
5151
window.location.pathname.startsWith('/en/') ? '/en' : '')
5252
: '';
5353

54-
// 跳转到示例详情页,保持语言前缀
54+
// 跳转到示例详情页,保持语言前缀,不使用路径斜杠,直接连接查询参数
5555
return currentLangPrefix ? `${currentLangPrefix}/example-detail?id=${exampleId}` : `/example-detail?id=${exampleId}`;
5656
}
5757

0 commit comments

Comments
 (0)