Skip to content

Commit 7095287

Browse files
committed
fix(assets): 修复 Electron 便携版相对路径加载 3D 模型失败的问题,优化 sync-version 脚本 (v0.8.57)
1 parent 128ef15 commit 7095287

13 files changed

Lines changed: 77 additions & 25 deletions

File tree

backend/nit_core/interpreter/rust_binding/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nit_rust_runtime"
3-
version = "0.8.56"
3+
version = "0.8.57"
44
edition = "2021"
55

66
[lib]

backend/nit_core/interpreter/rust_binding/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "nit_rust_runtime"
7-
version = "0.8.56"
7+
version = "0.8.57"
88
description = "NIT Rust Runtime"
99
requires-python = ">=3.8"
1010
dependencies = []

backend/nit_core/nit_terminal_auditor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nit_terminal_auditor"
3-
version = "0.8.56"
3+
version = "0.8.57"
44
edition = "2021"
55

66
[lib]

backend/nit_core/tools/work/CodeSearcher/src/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "CodeSearcher"
3-
version = "0.8.56"
3+
version = "0.8.57"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pero-backend"
3-
version = "0.8.56"
3+
version = "0.8.57"
44
description = "萌动链接:PeroperoChat! 后端服务"
55
requires-python = ">=3.10,<3.11"
66
dependencies = [

backend/vision_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pero_vision_core"
3-
version = "0.8.56"
3+
version = "0.8.57"
44
edition = "2021"
55

66
[lib]

backend/vision_core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "pero_vision_core"
7-
version = "0.8.56"
7+
version = "0.8.57"
88
description = "High-performance computer vision core for Pero using Rust"
99
license = { text = "Apache-2.0" }
1010
authors = [

electron/main/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ ipcMain.handle('scan-local-models', async () => {
258258
return await scanLocalModels()
259259
})
260260

261+
// 暴露 app 根路径,供渲染进程将相对 assets/ 路径转换为 asset:// 绝对 URL
262+
ipcMain.handle('get-app-path', () => {
263+
return app.getAppPath()
264+
})
265+
261266
// 3D 模型资产扫描 (包括 Workshop)
262267
ipcMain.handle('scan-3d-models', async () => {
263268
return await scan3DModels()

electron/preload/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ contextBridge.exposeInMainWorld('electron', {
1313
ipcRenderer.invoke('native-load-standard-model', buffer, filterPatterns),
1414
loadPeroContainer: (buffer: Uint8Array) =>
1515
ipcRenderer.invoke('native-load-pero-container', buffer),
16-
scanLocalModels: () => ipcRenderer.invoke('scan-local-models')
16+
scanLocalModels: () => ipcRenderer.invoke('scan-local-models'),
17+
// 暴露应用根路径,供渲染进程将相对 assets/ 路径转换为 asset:// 绝对路径
18+
appPath: () => ipcRenderer.invoke('get-app-path')
1719
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "peropero-chat",
33
"private": true,
4-
"version": "0.8.56",
4+
"version": "0.8.57",
55
"description": "萌动链接:PeroperoChat!- 一个充满活力的 3D 桌面宠物应用",
66
"author": "YoKONCy",
77
"license": "Apache-2.0",

0 commit comments

Comments
 (0)