Closed PeachScript closed 1 week ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
在 routePreloadOnLoad.ts
文件中,添加了一个新检查,以跳过绝对路径不以 '/' 开头的非法路由。如果遇到这样的路由,将记录一条错误信息,并在处理时跳过该路由。
文件路径 | 变更摘要 |
---|---|
packages/preset-umi/src/features/routePreloadOnLoad/routePreloadOnLoad.ts | 在函数 getRoutePathFilesMap 中,添加了一个检查,以跳过绝对路径不以 '/' 开头的非法路由。 |
sequenceDiagram
participant Client
participant getRoutePathFilesMap
participant Logger
Client->>getRoutePathFilesMap: Call function
getRoutePathFilesMap-->>Logger: Log error if path does not start with '/'
getRoutePathFilesMap-->>Client: Skip route if path is invalid
路由路径要记牢,
绝对路径 '/' 开头。
若是非法需跳过,
错误信息记录好。
代码流程更可靠,
开发测试都欢笑。 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Size Change: +33 B (0%)
Total Size: 9.93 MB
Filename | Size | Change |
---|---|---|
./packages/preset-umi/dist/features/routePreloadOnLoad/routePreloadOnLoad.js |
3.06 kB | +33 B (+1.09%) |
同 #12363
由于前述 PR 只合并到 feature 分支,而 feature 分支暂时还不合并到 master,所以重新提个 PR 到 master 修复该问题
Summary by CodeRabbit