Skip to content

fix(index): update dynamic base path fallback to use current directory#425

Merged
xrgzs merged 1 commit intoOpenListTeam:mainfrom
xrgzs:fix/dynpath
Mar 18, 2026
Merged

fix(index): update dynamic base path fallback to use current directory#425
xrgzs merged 1 commit intoOpenListTeam:mainfrom
xrgzs:fix/dynpath

Conversation

@xrgzs
Copy link
Member

@xrgzs xrgzs commented Mar 18, 2026

Description / 描述

window.__dynamic_base__ 的默认 fallback 值改为 .。修复访问 Web 报错问题。

Motivation and Context / 背景

Vite 的 preload-helper-xxx.js 动态拼接:

var e = `modulepreload`
  , t = function(e) {
    return `/${window.__dynamic_base__}/` + e
}

window.__dynamic_base__ 为空时,路径会被解析成域名,从而出现问题:

cf21a55f5ccb195fb145d1db778ef333

Relates to #417

感谢 @j2rong4cn

How Has This Been Tested? / 测试

本地打包 dist 拷贝到后端编译测试没问题,也不会影响到 CDN 功能。

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
@xrgzs xrgzs requested review from j2rong4cn and jyxjjj March 18, 2026 04:55
@xrgzs xrgzs merged commit 06cf398 into OpenListTeam:main Mar 18, 2026
1 check passed
@xrgzs xrgzs deleted the fix/dynpath branch March 18, 2026 05:19
xrgzs added a commit to xrgzs/OpenList-Frontend that referenced this pull request Mar 18, 2026
xrgzs added a commit that referenced this pull request Mar 18, 2026
* Revert "fix(index): update dynamic base path fallback to use current directory (#425)"

This reverts commit 06cf398.

* fix(vite): add patch for vite-plugin-dynamic-base to update dynamic base path handling

---------

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
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