Skip to content

fix: 修复游戏封面图无法显示的问题 (#643) - #648

Merged
MakinoharaShoko merged 2 commits into
OpenWebGAL:devfrom
boomwwww:fix/cover-image-display
Sep 1, 2026
Merged

fix: 修复游戏封面图无法显示的问题 (#643)#648
MakinoharaShoko merged 2 commits into
OpenWebGAL:devfrom
boomwwww:fix/cover-image-display

Conversation

@boomwwww

@boomwwww boomwwww commented Aug 29, 2026

Copy link
Copy Markdown
Member

问题

Dashboard 中游戏封面图有时无法显示。

根因:后端 getGameConfig 解析 config.txt 时未对键和值做 trim。当配置项存在首尾空格(如 Title_img: bg.png)时,解析出的 key 带前导空格,无法匹配 Title_img 字段,导致封面图路径落空、请求 404。

改动

  • packages/terre2/src/Modules/manage-game/manage-game.service.ts
    • getGameConfig 解析 config.txt 时对 key 和 value 均调用 trim(),修复根因
  • 顺带修正packages/origine2/src/pages/dashboard/GameElement.tsx变量名拼写 soureBase → sourceBase

测试方法

  1. 在游戏配置 Title_img: 后加一个空格(如 Title_img: bg.png
  2. 启动项目(yarn + yarn dev)
  3. 进入 Dashboard,确认该游戏封面图正常显示

Fixes #643

config.txt 中键或值存在首尾空格时,解析结果带空格导致字段匹配失败。因此要对 key 和 value 均做 trim 处理。
@boomwwww boomwwww changed the title fix: 修复Dashboard中有时游戏封面图无法显示的问题 fix: 修复游戏封面图无法显示的问题 (#643) Aug 29, 2026
@MakinoharaShoko
MakinoharaShoko merged commit aff1636 into OpenWebGAL:dev Sep 1, 2026
7 checks passed
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.

2 participants